我的 Android 应用程序使用 SOAP 请求,
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.calottery.com/">
<soapenv:Header/>
<soapenv:Body>
<ser:GetCurrentGameInfo/>
</soapenv:Body>
</soapenv:Envelope>
When I test this using SOAPUI, I'm getting the Response(edited to minimum details) as ,
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetCurrentGameInfoResponse xmlns="http://services.calottery.com/">
<GetCurrentGameInfoResult>
<xs:schema id="CurrentGameInfo" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="CurrentGameInfo" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:element name="QueryDate" type="xs:dateTime" minOccurs="0"/>
</xs:element>
</GetCurrentGameInfoResult>
</GetCurrentGameInfoResponse>
</soap:Body>
</soap:Envelope>
这是预期的结果。但是当我从 Android 代码中执行此操作时,如下所示,
SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE transport=new HttpTransportSE(URL);
try{
transport.call(SOAP_ACTION, envelope);
SoapObject result=(SoapObject)envelope.bodyIn;
Log.v("Response", result.toString());
}
catch(Exception e){ e.printStackTrace(); }
我得到的回应是
anyType{schema=anyType{element=anyType{complexType=anyType{choice=anyType{element=anyType{complexType=anyType{sequence=anyType{element=anyType{}; }; }; }; element=anyType{complexType=anyType{sequence=anyType{element=anyType{};