我正在尝试使用ksoap2来使用web服务,这是调用
public String startDelivery() {
final String METHOD_NAME = "startDelivery";
final String SOAP_ACTION = "the URL to the webMethod";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo propInfo = new PropertyInfo();
propInfo.setName("userid");
propInfo.setType(PropertyInfo.STRING_CLASS);
propInfo.setValue("1");
request.addProperty(propInfo);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject resultsRequestSOAP = (SoapObject) envelope.getResponse();
return resultsRequestSOAP.toString();
} catch (IOException e) {
e.printStackTrace();
} catch (XmlPullParserException e) {
e.printStackTrace();
}
return null;
}
但我收到此错误
SoapFault - faultcode: 'S:Server' faultstring: 'java.lang.IllegalStateException' faultactor: 'null' detail: null at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:141) at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140) at org.ksoap2.transport.Transport.parseResponse(Transport.java:116)at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:259)
我的想法请帮忙谢谢