我试图了解如何在 Android 上使用 ksoap。我已经执行了这个 ksoap 请求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:namespace">
<soapenv:Header/>
<soapenv:Body>
<urn:"method name">
<urn:mode>"value"</urn:mode>
</urn:method name>
</soapenv:Body>
</soapenv:Envelope>
通过 AndroidHttpClient 在 HttpPost 的实体部分中。我尝试用 ksoap 做类似的事情:
SoapObject root = new SoapObject(NAMESPACE, "method name");
PropertyInfo pr = new PropertyInfo();
mode.setName("mode");
mode.setValue("value");
root.addProperty(pr);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(root/*request*/);
Log.d(TAG, envelope.toString());
HttpTransportSE transport = new HttpTransportSE(url);
try {
transport.call(NAMESPACE.concat("/").concat("method name"), envelope);
Object obj = (Entity) envelope.getResponse();
,但我有一个例外
SoapFault - faultcode: 'SOAP-ENV:Server' faultstring: 'Processing Failure' faultactor: 'null' detail: org.kxml2.kdom.Node@44f7cab0
你能给我一个这个简单请求的例子来了解它是如何工作的吗?