[英]How can I display Sap Soap webservices Response in Android?
httpTransport.call(SOAP_ACTION, envelope); httpTransport.call(SOAP_ACTION,信封);
SoapPrimitive response = (SoapPrimitive) envelope.getResponse(); SoapPrimitive响应=(SoapPrimitive)信封.getResponse();
and I also used Object result = envelope.getResponse(); 而且我还使用了Object result = wallet.getResponse();
I am using The above code for Handling Response in Android but i got the following exception: 我在Android中使用上述代码处理响应,但出现以下异常:
02-25 17:17:35.185: WARN/System.err(9786): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG [{http://schemas.xmlsoap.org/wsdl/}wsdl:definitions targetNamespace='urn:sap-com:document:sap:soap:functions:mc-style'>@1:686 in java.io.InputStreamReader@4052d3f0)][1]
How can Handle that exception in android 如何在Android中处理该异常
How are you performing the SOAP call? 您如何执行SOAP调用? Are you using KSOAP2?
您在使用KSOAP2吗? In that case,
在这种情况下,
Set transport.debug = true
设置
transport.debug = true
Log transport.responseDump
in case of exception. 如果发生异常,请记录
transport.responseDump
。 Most likely you are getting an error message, as opposed to a proper SOAP/xml response. 与正确的SOAP / xml响应相反,您很可能会收到一条错误消息。
Your literal question was "how to handle the exception". 您的字面问题是“如何处理异常”。 You do this by wrapping your transport.call in the appropriate try except, ie
您可以通过将您的transport.call包装在适当的尝试中来实现,除了
try
{
transport.call(SOAP_ACTION, envelope);
// ... envelope.getResponse() ...
}
catch(XMLPullParserException e)
{
Log.e(TAG, e.getDetail(), e);
Log.d(TAG, transport.requestDump);
Log.d(TAG, transport.responseDump);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.