Hi guys,
I am developing a http engine using http client api ( RHTTPSession, RHTTPTransaction ).
but problem is when i submit my transaction system shows a list a access point to choose from. But i dont want this list to be displayed, instead i should be able to specify a access point in the code itself.
I found some topics on this forum about it, but when I tried use sample code,
it is not works, still the access point selection pop up is coming...
Anybody had same problem yet? Please help.
Here is my code, which not works. Where is my mistakes?
Thanks in advance.Code:void CHTTPEngine::GetRequestL(const TDesC& aUri) { // Initialise the socket server session. RSocketServ socketServ; User::LeaveIfError(socketServ.Connect()); // Initialise the RConnection. RConnection connection; User::LeaveIfError(connection.Open(socketServ)); // open the IAP communications database CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP); CleanupStack::PushL(commDB); // initialize a view CCommsDbConnectionPrefTableView* commDBView = commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing); // go to the first record User::LeaveIfError(commDBView->GotoFirstRecord()); // Declare a prefTableView Object. CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref; // read the connection preferences commDBView->ReadConnectionPreferenceL(pref); TUint32 iapID = pref.iBearer.iIapId; // pop and destroy the IAP View CleanupStack::PopAndDestroy(commDBView); // pop and destroy the database object CleanupStack::PopAndDestroy(commDB); // Now we have the iap Id. Use it to connect for the connection. // Create a connection preference variable. TCommDbConnPref connectPref; // setup preferences connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt); connectPref.SetDirection(ECommDbConnectionDirectionOutgoing); connectPref.SetBearerSet(ECommDbBearerGPRS); connectPref.SetIapId(iapID); // start a synchronous connection TInt errConnect = connection.Start(connectPref); // Then, associate the current socket server session and rconnection object //used above with the HttpSession which u will be using. RStringPool strP = iSession.StringPool(); RHTTPConnectionInfo connInfo = iSession.ConnectionInfo(); connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable() ), THTTPHdrVal (socketServ.Handle())); TInt connPtr = REINTERPRET_CAST(TInt, &(connection)); connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ), THTTPHdrVal (connPtr) ); // Parse the URI ParseUriL(aUri); // Create the transaction iTransaction = iSession.OpenTransactionL(iUriParser, *this, iSession.StringPool().StringF(HTTP::EGET, RHTTPSession::GetTable())); // Set transaction headers RHTTPHeaders headers = iTransaction.Request().GetHeaderCollection(); AddHeaderL(headers, HTTP::EUserAgent, KUserAgent); AddHeaderL(headers, HTTP::EAccept, KAccept); // Submit the request iTransaction.SubmitL(); }
Svat_

Reply With Quote


