私は ksaop2-android を使用して Web サービスを生成しています。使用する wsdl は次のとおりです: http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL
これは私のコードです:
String serviceUrl = "http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL";
String methodName = "GetCityWeatherByZIP";
SoapObject request = new SoapObject("http://ws.cdyne.com/WeatherWS/",
methodName);
request.addProperty("ZIP", "64101");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER12);
envelope.dotNet = false;
envelope.setOutputSoapObject(request);
HttpTransportSE ht = new HttpTransportSE(serviceUrl);
try {
ht.call("http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP", envelope);
if (envelope.getResponse() != null) {
SoapObject soapObject = (SoapObject) envelope.getResponse();
System.out.println(soapObject.getProperty("ResponseText"));
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
この URL で正しい応答を得ることができます: http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP?ZIP=64101
ただし、私のコードは次のような応答を返します。
気象データに市が見つかりませんでした。詳しくはCDYNEまでお問い合わせください。
引数が送信されていないようですが、どの部分が間違っている可能性がありますか?