实际上我用这个代码来访问这个网络服务华氏度到摄氏度方法,我得到了正确的响应,但是当我尝试访问我的网络服务时得到
java.io.IOException:HTTP 请求失败,HTTP 状态:500
错误,它指向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();
}
直到这里我才得到正确的答复。我调试并检查了发送正文的值是否正确,并且对我来说,正文为空。
HTTP Status: 500 是一个内部服务器错误,它可能与您的 .NET 服务器端编码有关。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)