With the code below, I am getting this error:
08-20 12:01:01.606: WARN/System.err(939): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG @1:6 in java.io.InputStreamReader@4052df28)
Please give me idea where I go wrong.
This is the code I wrote:
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER12);
envelope.setOutputSoapObject(request);
try {
HttpTransportSE httpTransport = new HttpTransportSE(URL);
httpTransport.call(SOAP_ACTION, envelope);
// httpTransport.call(SOAP_ACTION, envelope);
SoapObject result = (SoapObject) envelope.bodyIn;
Log.i("Result........................", result.toString());
System.out.println(result);
Toast.makeText(SAPSoapWebservicesActivity.this, result.toString(),
50000).show();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
XML Parsing Error. When pre-required formatted Response is not received from the Server,while Parsing,the parser pushes this Exception.Suggestions:
Parsing the responsefrom Server,just go on to trace it by toasting or printing it on theLogCat.Parametersthat you are passing to theWeb Service Methodthat you are calling.If the requiredparameter or the method name does not match,it will give you an un appropiate response which while parsing will give this Exception as the Parser would be expecting"something else".