Actually I used this code to access this web service FahrenheitToCelsius Method, am getting the correct response, but when I tried to access my webservice am getting
java.io.IOException: HTTP request failed, HTTP status: 500
error and it is pointing the transport.call(SOAP_ACTION, envelope);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
//Use this to add parameters
request.addProperty("username",usr);
request.addProperty("password",pass);
request.addProperty("backOfficePartnerId",id);
//Declare the version of the SOAP request
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
try {
HttpTransportSE transport = new HttpTransportSE(URL);
Log.i("bodyout", "" + envelope.bodyOut.toString());
transport.call(SOAP_ACTION, envelope);
// Get the SoapResult from the envelope body.
SoapObject result = (SoapObject)envelope.bodyIn;
System.out.println("result IN F TO C::"+result);
}catch(Exception e){
e.printStackTrace();
}
Am getting the correct response till here. I debuged and checked the values am sending the body out that is correct and in response for me the bodyin is null.
The HTTP Status: 500 is an internal server error and it probably has something to do with your .NET server side coding.
change VER10 to VER11. SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11) working for me
I searched a lot but couldn't find any specific solution. I solved my problem by downloading new server package(of same version) and replaced the previous server package by new one .(about Apache tomcat 7)
来源:https://stackoverflow.com/questions/15809391/soap-throws-java-io-ioexception-http-request-failed-http-status-500