Friday, 27 September 2013

soap ui call for .net soap service success but fails with http 500 in ksoap2 android

soap ui call for .net soap service success but fails with http 500 in
ksoap2 android

this is the service method
SOAPAction: "http://tempuri.org/LogInUser"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<LogInUser xmlns="http://tempuri.org/">
<us>
<UserName>string</UserName>
<Password>string</Password>
<CityName>string</CityName>
<DistrictOneName>string</DistrictOneName>
<DistrictTwoName>string</DistrictTwoName>
<DistrictThreeName>string</DistrictThreeName>
<BloodType>string</BloodType>
<Phone>string</Phone>
<Name>string</Name>
<Surname>string</Surname>
</us>
</LogInUser>
</soap:Body>
</soap:Envelope>
this is the how I call it in android that fails with IOException and HTTP
500 error yet,
SoapObject request = new SoapObject(NAMESPACE, METHOD);
SoapObject user = new SoapObject(NAMESPACE, "us");
user.addProperty("UserName", us.UserName);
user.addProperty("Password", us.Password);
user.addProperty("CityName", "?");
user.addProperty("DistrictOneName","?");
user.addProperty("DistrictTwoName","?");
user.addProperty("DistrictThreeName", "?");
user.addProperty("BloodType", "?");
user.addProperty("Phone", "?");
user.addProperty("Name", "?");
user.addProperty("Surname", "?");
request.addSoapObject(user);
Log.d(TAG, request.toString());
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE transport = new HttpTransportSE(URL);
transport.call(SOAP_ACTION, envelope);
I have done well in soap ui call.

No comments:

Post a Comment