其實我用這個代碼來訪問該Web服務FahrenheitToCelsius方法,我得到正確的響應,但是當我試圖訪問我的web服務正在逐漸肥皂java.io.IOException異常:HTTP請求失敗,HTTP狀態:500
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();
}
我得到正確的答覆,直到這裏。我嘔吐並檢查了發送身體的值是否正確,並且對我的反應是bodyin爲空。
我是否嘗試在其他地方訪問Web服務?它看起來像您的Web服務與您的請求崩潰。 – 2013-04-04 11:13:00
@AitorCalderon ::我在iPhone上嘗試了相同的URL並獲得了輸出, – Jeevanandhan 2013-04-04 11:17:26
您使用了哪些外部庫?我有類似的問題,我認爲它可能是圖書館。我正在使用ksoap2,httpmime4.0.1和apache-mime4j-0.6,並且一旦我刪除了最後2個錯誤消失了 – Roman 2013-04-18 21:59:14