这是我的异步代码
@Override
protected SoapObject doInBackground(String... params) {
try {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("ID", "0014");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.implicitTypes = false;
envelope.dotNet = true;
HttpTransportSE transport = new HttpTransportSE(URL);
try {
transport.call(SOAP_ACTION, envelope);
} catch (Exception e) {
e.printStackTrace();
}
try {
SoapFault fault = (SoapFault) envelope.bodyIn;
System.out.println("fault in getdata : " + fault);
} catch (Exception e) {
e.printStackTrace();
}
try {
result = (SoapObject) envelope.bodyIn;
System.out.println("result in getdata : " + result);
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
// System.out.println("Exception : " + e.toString());
}
return result;
}
我的回应是
result in getdata : Getesponse{GetResult=anyType{schema=anyType{element=anyType{complexType=anyType{choice=anyType
{element=anyType{complexType=anyType{sequence=anyType{element=anyType{}; element=anyType{}; element=anyType{};
element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; }; }; }; }; }; }; };
diffgram=anyType{DocumentElement=anyType{Table1=anyType{Name=Sathish1; Subject=anyType{}; ID=0014; }; }; }; }; }
在这里,我想要主题null
而不是anyType{}
. if
除了使用语句朋友检查之外,还有什么更好的主意吗?