KSOAP2 - HttpTransportSE.call上的IllegalStateException(调用(SOAP_ACTION,信封)

时间:2013-02-26 15:15:45

标签: android android-ksoap2

我正在尝试使用kso​​ap2来使用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)

我的想法请帮忙谢谢

0 个答案:

没有答案