I am trying to use SOAP 2.4 to validate a username and password using Android. I get a response from the server, I can confirm this as MySQL server confirmed my application made a request. However as you can see below I pass two parametres using the addProperty() method. MySQL server sees the request, but the values are null. As a result, I get a response saying “invalid username or password” however the username and password that I have hard coded is definitly in the database. Am I definitly passing the parametres correctly?
else {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); // set
// up
// request
request.addProperty("User", "raji"); // variable name, value. I got
// the variable name, from
// the wsdl file!
request.addProperty("Password", "PASSWORD");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11); // put all required data into a soap
// envelope
envelope.setOutputSoapObject(request); // prepare request
AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);
httpTransport.debug = true;
httpTransport.call(SOAP_ACTION, envelope); // send request
SoapObject result = (SoapObject) envelope.getResponse(); System.out.println(result);
}
Here is the SOAP XML file
<s:element name="ValidateUser">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="User" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
the solution code is here. I did not add the .net code