服务器无法处理您的请求,值不能为null:soap解析

时间:2014-10-02 06:16:36

标签: android xml web-services soap

请求肥皂请求它低于错误。

 10-02 06:05:05.840: E/@@@@@@@@@@(1722): RawXML Request:<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>Server was unable to process request. ---&gt; Value cannot be null.
    10-02 06:05:05.840: E/@@@@@@@@@@(1722): Parameter name: String</faultstring>
      <detail />
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

我真诚地通过了所需的参数,即使它的抛出错误。

这是我用于肥皂请求的功能。

ChangePassword

    public  void ChangePassword(String METHOD, String token,
            String userId, String oldPassword,String newPassword) {
        SoapObject  request = null;

        request = new SoapObject(NAME_SPACE, METHOD);

        Log.e("####", "ChangePassword token=" + token.trim());
        Log.e("####", "ChangePassword userId=" + userId);
        Log.e("####", "ChangePassword oldPassword=" + oldPassword);
        Log.e("####", "ChangePassword newPassword=" + newPassword);

        request.addProperty("token", token.trim());
        request.addProperty("userId", userId);
        request.addProperty("oldPassword", oldPassword);
        request.addProperty("newPassword", newPassword);

        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request);

        try {
            HttpTransportSE transport = new HttpTransportSE(URL);
            transport.debug = true;

            String action=SOAP_ACTION+METHOD;
            Log.e("@@@@", "soap action="+action);

            transport.call(action, envelope);
//          transport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");  

            String response = transport.responseDump;
            Log.e("@@@@@@@@@@","RawXML Request:"+response.toString());


        } catch (Exception e) {
            e.printStackTrace();
        }

    }

在点击请求时是否有任何遗漏?

1 个答案:

答案 0 :(得分:6)

我怀疑您的网络服务存在问题。确保所有参数名称与您在Android应用程序中使用的值匹配。