×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174

    HTTP post in S60 2nd edition is not Working..

    This code is working good in 3rd edition but its not working in 2nd edition if i post data i'm not getting any response from the server. i'm checking in device because in emulator its not connecting to network i have done all the network configuration..
    i have enabled all the gprs settings but still i'm not getting any response from the server after the post.. plz somebody help me..

    void CClientEngine::IssueHTTPPostL(const TDesC8& aUri,
    const TDesC8& aContentType,
    const TDesC8& aBody)
    {

    SetupConnectionL();

    TUriParser8 uri;
    uri.Parse(aUri);

    delete iPostData;
    iPostData = aBody.AllocL();

    RStringF method = iSession.StringPool().StringF(HTTP::EPOST,
    RHTTPSession::GetTable());

    iTransaction = iSession.OpenTransactionL(uri, *this, method);

    RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
    SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
    SetHeaderL(hdr, HTTP::EAccept, KAccept);
    SetHeaderL(hdr, HTTP::EContentType,KContentType);

    MHTTPDataSupplier* dataSupplier = this;
    iTransaction.Request().SetBody(*dataSupplier);

    iTransaction.SubmitL();
    iRunning = ETrue;
    }

    void CClientEngine::SetupConnectionL()
    {
    if( iConnectionSetupDone )
    return;

    iConnectionSetupDone = ETrue;

    User::LeaveIfError(iSocketServ.Connect());
    User::LeaveIfError(iConnection.Open(iSocketServ));

    CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(commDB);

    CCommsDbConnectionPrefTableView* commDBView =
    commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionUnknown);

    User::LeaveIfError(commDBView->GotoFirstRecord());

    CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref;

    commDBView->ReadConnectionPreferenceL(pref);
    TUint32 iapID = pref.iBearer.iIapId;

    CleanupStack::PopAndDestroy(commDBView);
    CleanupStack::PopAndDestroy(commDB);
    TCommDbConnPref connectPref;

    connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    connectPref.SetDirection(ECommDbConnectionDirectionUnknown);
    connectPref.SetBearerSet(ECommDbBearerGPRS);
    connectPref.SetIapId(iapID);

    User::LeaveIfError(iConnection.Start(connectPref));

    RStringPool strPool = iSession.StringPool();
    RHTTPConnectionInfo connInfo = iSession.ConnectionInfo();

    connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketServ,
    RHTTPSession::GetTable() ), THTTPHdrVal (iSocketServ.Handle()) );

    connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketConnection,
    RHTTPSession::GetTable() ),
    THTTPHdrVal (REINTERPRET_CAST(TInt, &(iConnection))) );
    }

    if i run in emulator i'm getting this error -5120.


    thanking you...

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: HTTP post in S60 2nd edition is not Working..

    Did you debug and check if you are getting any errors, is your connection setup function able to create the connection successfully?
    Cheers,
    Mayank

  3. #3
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: HTTP post in S60 2nd edition is not Working..

    Also check if your emulator is configured properly. Try to open any web page from the emulator to make sure that no proxy issues or ethernet config is required.

  4. #4
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174

    Re: HTTP post in S60 2nd edition is not Working..

    thank you for your replies...
    i'm getting -5120 error whats this error..
    its working fine in s60 2nd ed fp3 (n72) device and its not working in s60 2nd ed 6600 I'm getting -5120 error only in 6600 plz somebody help me...
    if i try to open some web page in emulator it displaying no gateway reply but i configured Ethernet then also I'm facing problem. i tried in all the s60 2nd edition emulators...
    Last edited by keerthi.ck06; 2009-05-25 at 08:14.

  5. #5
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: HTTP post in S60 2nd edition is not Working..

    Well if it works on 1 doesnt necessarily guarantee it works on another SDK, however this is what your error means :-

    DndTimedOut -5120 No response from DNS server

    So check if there is a DNS server involved somewhere in your connection, if yes then check why it wont send u a response in the stipulated time.
    Cheers,
    Mayank

  6. #6
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174

    Re: HTTP post in S60 2nd edition is not Working..

    hi how to check that DNS is involved or not and i also checked in all 2nd edition, its working in 2nd fp1,fp2,fp3 but its not woking in 2nd without fp like 6600.. my question is will this http post work in 6600..?

  7. #7
    Regular Contributor
    Join Date
    Jun 2007
    Posts
    77

    Re: HTTP post in S60 2nd edition is not Working..

    Hi, I would like to know the solution for this issue. Since i have tested HttpTaskManger example in 3rd edition, 2nd edition emulator and working fine, but failed in 2nd edition(6630,N72)mobiles.I'm getting timeout error and request is failed to hit the target. Can anyone tel me the solution please?

  8. #8
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174

    Re: HTTP post in S60 2nd edition is not Working..

    that problem is due to configuration settings check the settings...

Similar Threads

  1. Python for S60 1.9.3 released
    By tvijayan in forum Symbian
    Replies: 40
    Last Post: 2009-04-03, 15:00
  2. Background SMS Send s60 2nd Edition
    By symbee in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2008-09-12, 15:33
  3. Problem with S60 2nd Edition from Carbide Editor
    By nital_shah in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2008-07-12, 12:13
  4. Replies: 2
    Last Post: 2008-03-01, 03:32
  5. Read & Write AT commands on S60 2nd edition phones
    By jp4symbian in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2007-06-22, 07:55

Posting Permissions

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