Re: Bug??

[email protected] Tue, 15 Apr 2003 15:45:18 +0200
Newsgroups gmane.comp.java.enhydra.ksoap
Message-ID <[email protected]>
Hi,

Could you please give an example of the envelope you would like to parse ?

Did u talk about an empty message body ???

Regards,

----------------------------------------------------------------------------
Sebastien Petrucci
Java Technology Consultant - Altran Europe
Philips Remote Control Systems
Interleuvenlaan 74-76, B-3001 Leuven (Belgium)
M +32(0)497502521    T  +32(0)16394 598
----------------------------------------------------------------------------









Wolfgang Beer <[email protected]>
Sent by: 
[email protected]
2003-04-15 15:27
Please respond to ksoap

 
        To:     [email protected]
        cc:     (bcc: Sebastien Petrucci/LEU/COMP/PHILIPS)
        Subject:        Ksoap:  Bug??
        Classification: 



Hi there,

I had a problem with the kSOAP2 class SoapSerializationEnvelope. When i 
was 
parsing SOAP envelopes with it
it was not possible to parse SoapCalls with empty msg bodys in it!
I checked the parseBody method of class SoapSerializationEnvelope and the 
call to method readUnknown(...).

I think the problem lies in the very early call of parser.next() in line 
4. 
It cant read the start tag
of the unknown object because it is already set to the start object, so it 

fails.
If i put the parser.next() call after the SoapObject is created it works 
well:

protected Object readUnknown(XmlPullParser parser, String typeNamespace, 
String typeName)
                                         throws IOException, 
XmlPullParserException {
         String name = parser.getName ();
         String namespace = parser.getNamespace();
         // parser.next() original position
      Object result = null;
         String text = null;

      if (parser.getEventType() == XmlPullParser.TEXT) {
         text = parser.getText();
            result = new SoapPrimitive(typeNamespace, typeName, text);
            parser.next();
      }
         if (parser.getEventType() == XmlPullParser.START_TAG) {
         if (text != null && text.trim().length() != 0)
                 throw new RuntimeException("Malformed input: Mixed 
content");

      SoapObject so = new SoapObject(typeNamespace, typeName);
         parser.next(); // parser.next() new position??
      while (parser.getEventType() != XmlPullParser.END_TAG) {
         //...
         //...
         //...
//...

please somebody could answer my question if this is a bug or i didnt 
realize how it should work...

best greetings
Wolfgang

_______________________________________________
Ksoap mailing list
[email protected]
http://www.enhydra.org/mailman/listinfo.cgi/ksoap