简体   繁体   English

如何在Android中显示Sap Soap Webservices响应?

[英]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, 在这种情况下,

  1. Set transport.debug = true 设置transport.debug = true

  2. 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.

相关问题 如何在Android中显示Sap Soap webservices响应? 使用kso​​ap2 - How can I display Sap Soap webservices Response in Android ? using ksoap2 没有Ksoap2的情况下如何在Android中调用SAP SOAP Web服务? - How can Iinvoke SAP SOAP webservices in Android Without Ksoap2? 如何从Android调用SAP SOAP Web服务? 使用用户名和密码。 - How can i Invoke SAP SOAP webservices from Android? with username and password.? 如何使用SAP SOAP WSDL在Android SOAP webservices程序中添加用户名和密码作为URL参数? - How can Add username and password as URL parameter in Android SOAP webservices program with SAP SOAP WSDL? 如何使用SAP SOAP WSDL在Android SOAP webservices程序中添加用户名和密码作为URL参数? 桌面浏览器贴脸 - How can Add username and password as URL parameter in Android SOAP webservices program with SAP SOAP WSDL? with desktop browser cheeking 如何在Android SOAP Webservices中将InputStream数据转换为String - How can I convert InputStream data to String in Android SOAP Webservices Android与SAP SOAP Web服务之间的连接建立 - Connection Establishment between Android and SAP SOAP Webservices Android如何解析和使用Web服务? - Android how I can parse and consume webservices? 如何在 Android 中解析 SOAP WebServices XML 数据? - How to parse SOAP WebServices XML data in Android? 在Android登录中使用Soap WebServices - Soap webservices in android login
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM