RobinHood
RobinHood

Reputation: 10969

Server was unable to process your request, Value cannot be null :soap parsing

While requesting soap request its throw below error.

 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>

I passed required parameter sincerely even though its throw error.

This is function which I used for soap request.

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

    }

is there anything I missed while hitting request?

Upvotes: 4

Views: 2836

Answers (1)

ChaturaM
ChaturaM

Reputation: 1557

I suspect there is an issue in your web service. Make sure all your parameter names are matching with the values you have used in your android app.

Upvotes: 6

Related Questions