×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    38

    how to send xml content over http post method

    hi,
    i need to send xml content like "<?xml version="1.0"?><testApp><version>1.0</version><testApp>" to web server, but in server our jsp page interpret this "<" symbol to "%3C" and other charaters to their respective hex value.

    tell me how to send special characters over http post. here i am not sending xml file, just content is xml formatted.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: how to send xml content over http post method

    How do you post it?

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    38

    Re: how to send xml content over http post method

    _LIT(KSendStr, "<?xml version=\"1.0\"?><sampleApp><version>1.0</version><date>Tue, 26 Feb 2008 02:00:00</date></sampleApp>");
    sendStr8.Copy(KSendStr);
    iClient->IssueHTTPPostL(uri8, KMimeType, sendStr8);

    i am using ClientEngine.cpp file.

    in server side it is interpreted as %3C%3Fxml + version and etc...
    Last edited by arayappan_it; 2008-04-30 at 10:59.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: how to send xml content over http post method

    What is KMimeType? Basically what you see is called URL encoding (http://en.wikipedia.org/wiki/Url_encoding). If KMimeType says ...something...-urlencoded, that can be a reason.

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    38

    Re: how to send xml content over http post method

    i am using application/x-www-form-urlencoded as mime type

    _LIT8(KMimeType, "application/x-www-form-urlencoded");
    _LIT8(KAccept, "*/*");
    _LIT8(KAccept1, "text/xml");
    _LIT8(KUserAgent, "sampleApp HTTP Client 1.0");
    void CClientEngine::IssueHTTPGetL(const TDesC8& aUri)
    {
    SetupConnectionL();

    // Parse string to URI (as defined in RFC2396)
    TUriParser8 uri;
    uri.Parse(*(EscapeUtils::EscapeEncodeL(aUri, EscapeUtils::EEscapeNormal)));

    // Get request method string for HTTP GET
    RStringF method = iSession.StringPool().StringF(HTTP::EGET,
    RHTTPSession::GetTable());

    // Open transaction with previous method and parsed uri. This class will
    // receive transaction events in MHFRunL and MHFRunError.
    iTransaction = iSession.OpenTransactionL(uri, *this, method);

    // Set headers for request; user agent and accepted content type
    RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
    SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
    SetHeaderL(hdr, HTTP::EAccept, KAccept);

    // Submit the transaction. After this the framework will give transaction
    // events via MHFRunL and MHFRunError.
    iTransaction.SubmitL();

    iRunning = ETrue;
    _LIT(KConnecting,"Connecting...");
    //iObserver.ClientEvent(KConnecting);
    }

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: how to send xml content over http post method

    Then that is the cause. JSP environment should de-code it for you, however I do not know the details.

  7. #7
    Registered User
    Join Date
    Feb 2008
    Posts
    38

    Re: how to send xml content over http post method

    hi,

    Thank you.. Is there anyway to encode from symbian client side and then send it to web server?. the main problem is jsp interprets it as hex values instead of reading its original string or character.
    can i do anything manually(for example, replace "<" with some other characters) to solve this issues in server side without changing jsp page or use of any functions to solve this?

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: how to send xml content over http post method

    You could do a HTTP POST.

  9. #9
    Registered User
    Join Date
    Feb 2008
    Posts
    38

    Re: how to send xml content over http post method

    hi,

    thank you...

  10. #10
    Registered User
    Join Date
    Feb 2010
    Posts
    8

    Re: how to send xml content over http post method

    hi, arayappan_it
    were u able to use the symbian hhtp-client to interact with the facebook website?...

  11. #11
    Registered User
    Join Date
    Aug 2009
    Posts
    14

    Re: how to send xml content over http post method

    Quote Originally Posted by jayanand.uc View Post
    hi, arayappan_it
    were u able to use the symbian hhtp-client to interact with the facebook website?...
    HI arayappan,
    Did u resolve the issue. me too experiencing the same issue.
    using Http post method i need to post xml as data to server. the same way u were trying,
    Eg:
    _LIT(KSendStr, "<?xml version=\"1.0\"?><sampleApp><version>1.0</version><date>Tue, 26 Feb 2008 02:00:00</date></sampleApp>");
    sendStr8.Copy(KSendStr);
    iClient->IssueHTTPPostL(uri8, KMimeType, sendStr8);

    The server couldn't understand the xml as string! Did u find any URL ENCODE procedure for symbian.

    Thanks
    Senthilv

Similar Threads

  1. http example post method problem
    By nabaparna in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2007-06-28, 08:58
  2. Problems with http - POST
    By bigbadwolf in forum Symbian Networking & Messaging (Closed)
    Replies: 13
    Last Post: 2007-01-17, 23:45
  3. Http Post problem (406 Not Acceptable) in 6230
    By brunoghisi in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-11-27, 17:36
  4. Replies: 0
    Last Post: 2002-11-21, 14:56
  5. 7650 J2ME/MIDP HTTP Post
    By cwalkinshaw in forum Mobile Java General
    Replies: 2
    Last Post: 2002-10-23, 10:12

Posting Permissions

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