0
我是Web服務新手,正在寫一個可以與Web服務通信的Android應用程序。但是,當我試圖表明在android屏幕的結果,它顯示:獲取格式錯誤的SOAP響應
MethodNameResponse{MethodNameResult=anyType{};}
Web服務是應該做的服務器數據庫和後期結果一個簡單的查詢,這裏是方法的代碼調用網絡服務:
public void Convert(String val) {
try {
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,METHOD_NAME);
PropertyInfo p = new PropertyInfo();
p.setName(PROPERTY_NAME);
p.setValue(val);
p.setType(String.class);
request.addProperty(p);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE ahs = new HttpTransportSE(SOAP_ADDRESS);
ahs.call(SOAP_ACTION, envelope);
SoapObject response = (SoapObject) envelope.bodyIn;
TextView.setText(response.toString());
} catch (Exception e) {
Log.e(TAG, e.toString());
}
}
我的猜測是要麼服務有問題,要麼我錯誤地解釋數據。