Android kSOAP2 connecting to web service.

2019-03-01 18:42发布

问题:

I am trying to use kSOAP2 to connect an android device to a web service. If anyone is interested it is an SAP ABAP Webservice.

I am getting the following error:

10-30 15:21:42.395: I/System.out(18148): Error org.xmlpull.v1.XmlPullParserException:
expected: START_TAG {http://www.w3.org/2003/05/soap-envelope}Envelope (position:START_TAG <html>@1:7 in java.io.InputStreamReader@4138e570) 

My connection details to the url are: -

String NAMESPACE = "urn:sap-com:document:sap:rfc:functions";
String METHOD_NAME = "ZmobileGetTableDefinition";
String SOAP_ACTION = "urn:sap-com:document:sap:rfc:functions/ZmobileGetTableDefinition";
String URL = "http://localhost.com/sap/bc/srt/wsdl/sdef_ZMOBILE_REPORTING/wsdl11/ws_policy/document?sap-client=800?WSDL";

What does the error with the START_TAG imply.

Thanks

Martin

回答1:

Can you try to show the String that's returned from the webservice? It sounds like parsing error



回答2:

It was the webservice endpoint I need to specify rather than the WSDL.