显示在Android的肥皂Web服务的响应? [英] Display Soap Webservices Response in Android?
本文介绍了显示在Android的肥皂Web服务的响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
喜用ksoap2想在Android中显示SOAP Web服务。我使用下面的code。当我在肥皂UI正在测试临它显示输出中XML的罚款。
Hi Want display soap web services in Android by using ksoap2. I am using the following code . When I am testing in the Soap Ui Pro it shows ouput xml fine.
httpTransport.call(SOAP_ACTION, envelope);
Object result = (Object) envelope.getResponse();
System.out.println("The Result"+result);
但我正在逐渐在我的Eclipse的logcat异常,我怎么能在Android中克服这种
but I am getting the Exception in my Eclipse Logcat, how can I overcome this in Android
例外:
05-25 15:13:15.105: WARN/System.err(1160): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://www.w3.org/2001/12/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@40546438)
05-25 15:13:15.115: WARN/System.err(1160): at org.kxml2.io.KXmlParser.exception(KXmlParser.java:273)
请帮我。
推荐答案
使用以下code: -
Use Following Code:-
try {
httpTransport.call(SOAP_ACTION, envelope);
sb.append(httpTransport.requestDump);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
InputSource inStream = new InputSource();
inStream.setCharacterStream(new StringReader(sb.toString()));
如果u有任何疑问不是告诉我。
if u have any query than tell me.
这篇关于显示在Android的肥皂Web服务的响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文