Soap Throws java.io.IOException: HTTP request failed, HTTP status: 500

戏子无情 提交于 2019-12-02 02:02:59

问题


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.


回答1:


The HTTP Status: 500 is an internal server error and it probably has something to do with your .NET server side coding.




回答2:


change VER10 to VER11. SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11) working for me




回答3:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!