Search code examples
androidandroid-ksoap2

kSOAP2 output / org.xmlpull.v1.xmlpullparserexception expected start_tag


I have a standard code to call a .net webservice

I get exception "org.xmlpull.v1.xmlpullparserexception expected start_tag" at line

transportSE.call(SOAP_ACTION,soapSerializationEnvelope);

However, if i call the same webservice from a .NET code i get a well structured proper output as desired.

It primarily seems that from kSOAP2, there is a definite output that it gets but when it goes to parse further w.r.t SoapPrimitive objects, it fails.

So, is there other way to look at the actual output (actual soap envelope) received and then may be parse it myself appropriately.


Solution

  • Well now that I've solved my original problem hit this one!

    I found that ksoap2 couldn't parse the response... specifically org.kxml2.io.KXmlParser.require(type, namespace, name) threw the following exception.

    WARN/System.err(2330): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://www.w3.org/2001/12/soap-envelope}Envelope (position:START_TAG <h1>@1:4 in java.io.InputStreamReader@47ff3050) 
    

    Note that h1 tag. That comes from <h1>404 Not Found</h1> ... so yes, be aware your response may be from a website but not your web service :)

    Hope that helps someone one day