I post this here, since it is untirivial do
do with the SDK documentation.

TInt GetIapId(const TDesC &a)
{
CCommsDatabase* db = CCommsDatabase::NewL();
CleanupStack::PushL(db);
CApUtils* apUtils = CApUtils::NewLC(*db);

TUint32 t=0;
TUint32 r=0;
TBuf<256> name;

for(t=0;t<256 /* Enough ??*/;t++)
{ if( apUtils->CApUtils::IAPExistsL(t) )
{
name.Zero();
TRAPD(err,
r=apUtils->WapIdFromIapIdL(t);
apUtils->NameL(r,name) ;
);

if( name.CompareC( a ) ==0 )
{
CleanupStack::PopAndDestroy(2);
return t;
}
}
}
CleanupStack::PopAndDestroy(2);
return KErrNotFound;
}


The code is for Series60V2fp0-1, but may work with later too.

IapId is what you give to RConnection in order to connect it.