×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Sep 2013
    Posts
    6

    Parsing the xml content and adding it to the soapenvelope

    Hi,

    Anybody help me..

    I have a xml content and it has to be parsed and after that it has to be added to the SoapSerilizationEnvelope. Please guide me.

    Thanks in advance.

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

    Re: Parsing the xml content and adding it to the soapenvelope

    Is it a Java question? kSOAP2 perhaps?

  3. #3
    Registered User
    Join Date
    Sep 2013
    Posts
    6

    Re: Parsing the xml content and adding it to the soapenvelope

    I'm developing the application in j2me using webservices.

    My response has zipped content. So I have GzipInputStream to unzip the inputStream and this inputstream is set as input in the xmlpullparser and then this pull parser is added to envelope.

    but envelope is null. Please help me

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

    Re: Parsing the xml content and adding it to the soapenvelope

    Ok, the question is moved to the Java boards now.
    I am absoultely not familiar with kSOAP2, but in order to get some useful answers, it may make sense describing what is null exactly. What I found is http://ksoap2.sourceforge.net/doc/ap...nEnvelope.html, and it has a parseBody method with XmlPullParser.
    What happens then? Can you verify if the data is uncompressed correctly? Zip/GZip/Deflate/Inflate streams can behave tricky sometimes.

  5. #5
    Registered User
    Join Date
    Sep 2013
    Posts
    6

    Re: Parsing the xml content and adding it to the soapenvelope

    public void parseRes(InputStream is , SoapEnvelope env)
    {
    XmlPullParser xm = KxmlPullParser();
    xm .setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
    xm .setInput(is, "UTF-8"); ----------------------------------------------------------------->>>>>> Exception in this line : unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@8d608d6)
    envelope.parse(xm );
    }
    Last edited by YDeveloper; 2013-09-16 at 12:35.

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

    Re: Parsing the xml content and adding it to the soapenvelope

    I would check if 'is' happens to be null, or something valid. Also, since 'is' is supposed to contain some XML (e.g. human readable text), you can simply try reading a part of it into an array and check if it looks like an XML document or not.

  7. #7
    Registered User
    Join Date
    Sep 2013
    Posts
    6

    Re: Parsing the xml content and adding it to the soapenvelope

    InputStream is not null. Because I have checked the xml content by passing the inputstream into inputstreamreader. Its a xml content. So inputstream is not null.

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

    Re: Parsing the xml content and adding it to the soapenvelope

    Can you check the entire XML? In the exception it says position:END_DOCUMENT, so there may be something with the ending.

  9. #9
    Registered User
    Join Date
    Sep 2013
    Posts
    6

    Re: Parsing the xml content and adding it to the soapenvelope

    Thank you for your help. I have solved this problem.

Similar Threads

  1. LWUIT XMLParser parsing content in CDATA
    By ChinLoong in forum Mobile Java General
    Replies: 3
    Last Post: 2012-08-23, 15:41
  2. XML escaped content parsing
    By mstrug in forum Symbian
    Replies: 1
    Last Post: 2009-03-09, 11:23
  3. Replies: 5
    Last Post: 2008-06-13, 06:35
  4. Parsing file content
    By hendrawan.ashari in forum Symbian
    Replies: 7
    Last Post: 2007-03-09, 10:41
  5. Parsing the HTML content..?
    By mayankkedia in forum Symbian
    Replies: 2
    Last Post: 2007-02-21, 06:09

Posting Permissions

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