実際、私はこのコードを使用してこの Web サービスFahrenheitToCelsius Method にアクセスしましたが、正しい応答を得ていますが、Web サービスにアクセスしようとすると、
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();
}
ここまで正しい応答を得ています。私はデバッグして、値が正しいボディを送信していることを確認しました。これに応じて、ボディインはnullです。