×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    WebClient example: iClient->IssueHTTPGetL in ClientEvent

    Hi;

    I am using the WebClientEngine class from S60 Third Edition WebClient example. There is no problem in the first call of (done when the user clicks a command)

    Code:
    iClient->IssueHTTPGetL ( uri8);
    However after this transaction is succesfull I have to start another transaction. I am using the code below. WebClientEngine returns the following logs and the application crashes. The url is not broken, I've tried it.
    "Transaction Successful Transaction cancelled http://url Connecting..."

    Code:
    void CHelloWorldBasicAppUi::ClientEvent( const TDesC& aEventDescription)
    
    	{
    	HBufC8* buf8 = HBufC8::NewLC(aEventDescription.Length());
    	buf8->Des().Copy(aEventDescription);
    	logFile.Write(buf8->Des());
    	CleanupStack::PopAndDestroy(buf8);
    	
    	if ( aEventDescription.Compare (_L("Transaction Successful"))== 0)
    
    		{
    		iClient->CancelTransactionL ();
    		TBuf<KPrefixedUriNameLength> uri;
    		uri.Copy (_L("url"));
    
    		TBuf8<KPrefixedUriNameLength> uri8;
    
    		uri.LowerCase ();
    
    		if ( uri.Find ( KHttpPrefix)== KErrNotFound
    
    		&& uri.Find ( KHttpsPrefix)== KErrNotFound)
    
    			{
    
    			uri8.Append ( KHttpPrefix8);
    
    			uri8.Append ( uri);
    
    			}
    		else
    			{
    
    			uri8.Copy ( uri);
    
    			}
    
    		uri.Copy (uri8);
    		logFile.Write(uri8);			
    		gettingVersion = false;
    		iClient->IssueHTTPGetL ( uri8);
    	}
    }
    Do you have any idea?
    Thanks for your help.

  2. #2
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    135

    Re: WebClient example: iClient->IssueHTTPGetL in ClientEvent

    hi,

    you trying to send a http get with the url "http://url" which is strange isn't. It is that what you want to do?

    you build your url with
    uri.Copy (_L("url"));
    and insert "http://"

    As any method which name is ended by a L you should trap the call to the method.
    TRAPD(err, iClient->IssueHTTPGetL(...);


    Jean-philippe
    jean-philippe

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    Re: WebClient example: iClient->IssueHTTPGetL in ClientEvent

    First of all thanks for your answer.
    The code I sent is working fine when I use it in another function (command handling method). I used TRAPD(err, iClient->IssueHTTPGetL(...); as you mentioned and wrote err to log file. err = 0.
    The problem may be about the Submit in the engine? I am really confused.

  4. #4
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    135

    Re: WebClient example: iClient->IssueHTTPGetL in ClientEvent

    what I don't understand is that you build a url which is http://url . this is not a valid url !!!!

    maybe you wanted to do uri.Copy(url) rather than uri.Copy(_L("url");
    jean-philippe

Similar Threads

  1. UnknownEvent in WebClient
    By pietrodamb in forum Symbian
    Replies: 1
    Last Post: 2008-01-18, 07:20

Posting Permissions

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