我使用以下代码从 .Net Web 服务(asmx)获取响应。
try{
SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet =true;
AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);
envelope.setOutputSoapObject(request);
httpTransport.debug=true;
httpTransport.call(SOAP_ACTION, envelope);
SoapObject result=(SoapObject)envelope.getResponse();
String Text = result.getProperty(1).toString();
System.out.println("Text : " + Text);
}
catch (Exception e) {
e.printStackTrace();
}
当我尝试这段代码时,我得到了以下输出。
anyType{NewDataSet=anyType{ResponseTable=anyType{Result=Success; }; }; }
在这里,我需要“结果=成功”。
请帮我。