2014-10-02 107 views
4

请求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(); 
     } 

    } 

有什么我错过了,同时击中的要求吗?

+0

请将'Log.e'输出添加到您的问题。 – ashoke 2014-10-07 04:03:09

+0

第一句话后已添加。 – RobinHood 2014-10-07 04:05:16

+0

我怀疑是序列化问题,你可以添加所有其他'Log.e'消息吗? – ashoke 2014-10-07 04:08:26

回答

6

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