我正在尝试使用 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)
我没有想法请帮助谢谢