×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    122

    Unhappy access points problem with HTTP client api

    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?
    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();
    	}
    Thanks in advance.
    Svat_

  2. #2
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    122

    Re: access points problem with HTTP client api

    The problem is resolved

Similar Threads

  1. Another HTTP connection problem
    By issw in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2006-10-04, 16:36
  2. Problem connecting to multiple access points on 3G phones
    By yjforgod in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-03-30, 14:12
  3. Bluetooth client problem on games!
    By wmchan78 in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2006-03-22, 06:15
  4. File upload example using HTTP Client API???
    By jsstewart in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2005-05-19, 06:15
  5. HTTP Client API and IAP
    By llen in forum Symbian
    Replies: 0
    Last Post: 2004-05-18, 12:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×