×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Sending data through HttpClientExample_v2.0

    Hi,
    I have downloaded the HttpClientExample_v2.0 from this link below
    http://sw.nokia.com/id/b740b0e2-1201...le_v2_0_en.zip

    I want to make an application where my app will send some data to a web server. The above example has a function named IssueHttpPostL() which is used for posting any data to any server. I just want to know whether this method is sufficient or else I have to write a customized function for sending the data.

    The function
    Code:
    void CClientEngine::IssueHTTPPostL(const TDesC8& aUri,
             const TDesC8& aContentType,
             const TDesC8& aBody
             /*const TDesC8& iFileName*/)
    has a parameter const TDesC8& aBody which is collected in iPostData. Now when I make iTransaction.SubmitL(); will the data from iPostDatais sent to the desire server.

    Please provide me with this information.

  2. #2
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Sending data through HttpClientExample_v2.0

    Hi,
    I have downloaded the HttpClientExample_v2.0 from this link below
    http://sw.nokia.com/id/b740b0e2-1201...le_v2_0_en.zip

    I want to make an application where my app will send some data to a web server. The above example has a function named IssueHttpPostL() which is used for posting any data to any server. I just want to know whether this method is sufficient or else I have to write a customized function for sending the data.

    The function
    Code:
    void CClientEngine::IssueHTTPPostL(const TDesC8& aUri,
             const TDesC8& aContentType,
             const TDesC8& aBody
             /*const TDesC8& iFileName*/)
    has a parameter const TDesC8& aBody which is collected in iPostData. Now when I make iTransaction.SubmitL(); will the data from iPostDatais sent to the desire server.

    Please provide me with this information.

  3. #3
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Sending data through HttpClientExample_v2.0

    You want us to tell you whether an example that Forum Nokia published and you have in full code works or not? With a server that only you know about?

    You may start by explaining why do you think it would not work. Like maybe from your experience Forum Nokia's examples don't usually work ... Then you may want to explain why would you trust more our answer than your test results? Why don't you build the thing, point it to your server and see if it works?

    And here's my answer to your question: maybe. If the server to which you're sending the data is a web server and it has an application that waits for your data then yes, properly formatted data will reach the server. If any of these conditions are not met then no, the example will not work.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  4. #4
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Re: Sending data through HttpClientExample_v2.0

    what i expected was a simple answer. I am here to learn and if capable enough to help others. Anyways thanks for your reply.

    If anyone has gone through this example in person then please guide me in this context.

    Thanks
    Som

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Sending data through HttpClientExample_v2.0

    It does work, though I would suggest searching for threads where people have had problems with the post, they would get you started on the possible problems you might encounter.

  6. #6
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Re: Sending data through HttpClientExample_v2.0

    I tried to debug a few things out from this example and I found that the Post method is not working. What I did in the given example is as follows:

    Code:
    TRAPD(err, iTransaction.SubmitL());
    if(err != KErrNone) 
    			
    {
    			
    // Most common error; no access point configured, and session creation
    // leaves with KErrNotFound.
    iRunning = ETrue;
    _LIT(KConnecting,"Connecting...");
    iObserver.ClientEvent(KConnecting);
    				
    _LIT(msg, "Successfully posted");
    CAknInformationNote * inf= new (ELeave) CAknInformationNote;
    			inf->ExecuteLD(msg);
    _LIT(KConnecting,"Connecting..."); and _LIT(msg, "Successfully posted");
    CAknInformationNote * inf= new (ELeave) CAknInformationNote;
    inf->ExecuteLD(msg);


    The above two lines were given just after the submit function i.e., after this

    iTransaction.SubmitL()

    What i did is i tried to use ther TRAPD macro hear to check whether the Submit() is working or not.

    But when i run the application I am not able to see those two lines Connecting... and Sucessfu..

    That means the transaction is not submitted is it not?

    TRAPD was not used in teh original programSO I was able to see those two lines earlier before using TRAPD.

    SO I think this POST method is not working or I may be wrong .Please can you help me.

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Sending data through HttpClientExample_v2.0

    Maybe you could debug it a bit more to see what it is that is actually failing in there.

  8. #8
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Re: Sending data through HttpClientExample_v2.0

    Well I have no more ideas what to do in here . I am really stuck with this problem. You said that it works that means you have tested it right. SO can you tell me what you did in your server side program to acept the data...And I guess the buffer that is sending my data to the server is iPostData .SO can you help me with this.

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Sending data through HttpClientExample_v2.0

    you should propably google simple examples for receiving data on your server, the implementation depends on the language you use, also you can not balme the Nokia exmaple, if your server is not responding.

  10. #10
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Re: Sending data through HttpClientExample_v2.0

    Server program is in PHP. And it is correct according to the PHP team. So I am in real jeopardy.

  11. #11
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Sending data through HttpClientExample_v2.0

    So try then first GET, see that it works, the n try POST without data, and see that you get the request, and then see what happens with the data.

    Also you cna try using the browser on the mobile for GET request testing..

  12. #12
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Re: Sending data through HttpClientExample_v2.0

    Get is working fine. I have also checked in the browser in both the cases GET and POST. GET method works fine but not the POST method. THE PHP code is the same just they have to change the GET part to POST part SO in one caseit is working i.e with the GET part but not working with the POST part

  13. #13
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Sending data through HttpClientExample_v2.0

    So do you get the POST request in your server ?
    And only the data is missing ?
    Anyway, you could try debugging to see which states is reported for the request, it might give you a nice clue on what is going on there.

    Also, if you are just missing the data, then how is your code for handling the post data in the code.

  14. #14
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Re: Sending data through HttpClientExample_v2.0

    I debugged the code in this line i put a break point to check whether iPostData is receiving any data or not

    Code:
    iPostData = aBody.AllocL();
    When i checked it was not receiving any data. I have not made any changes in the code. It was in that way only

  15. #15
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Sending data through HttpClientExample_v2.0

    I was asking on your server side, do you get the request in there or not ?

    Also how did you test POST with the browser ?

Similar Threads

  1. [moved] Error in sending data from nokia emulator to servlet(server)
    By icecubebar in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-10-09, 09:39
  2. UDP Data Sending
    By yogesh.bhople in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2008-08-18, 11:08
  3. Sending allot of data by http
    By jaazz in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-03-12, 09:53
  4. Sending data to container
    By ninidotnet in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-12-28, 03:26
  5. suckho, i have encontered the same problems. Could you tell me how you resolved it?
    By dicson_hu in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2005-12-09, 10:56

Posting Permissions

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