0
我需要一些幫助。 我不能訪問我的web服務,白衣的AndroidAndroid白皮書中沒有SOAPAction標題
我使用KSoap2 3.0.0,我與Android冰淇淋三明治工作4.0.3(API 15)
當我撥打服務我得到這個迴應:
<faultstring>no SOAPAction header!</faultstring>
我告訴你我的代碼:
public void service()
{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
Element[] headers = new Element[1];
Element element = new Element();
element.setName("");
element.setNamespace(NAMESPACE);
headers[0] = element;
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
envelope.encodingStyle = SoapEnvelope.ENC;
envelope.setAddAdornments(false);
envelope.implicitTypes = true;
envelope.dotNet = false;
envelope.headerOut = headers;
envelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject resultsRequestSOAP = (SoapObject) envelope.body
}
我展示的WSDL代碼的第一部分:
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="xxx.xxx.xxx:xxxx/xxxx/xxxx" xmlns:intf="xxx.xxx.xxx" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="xxx:xx.xxx.xxxx.xxxx.xx.xxxx.xx" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xxx.xxx.xxx.xxx:xxxx/xxxx/xxxxxxxx/xxxxxxxxx">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="xxx:xx.xxx.xxxx.xxxx.xx.xxxx.xx">
<import namespace="http://xxx.xxx.xxx.xxx:xxxx/xxxx/xxxxxxxx/xxxxxxxxx"/>
<import namespace="http://xml.apache.org/xml-soap"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="SOCultivo">...</complexType>
<complexType name="SOUser">...</complexType>
<complexType name="SOInfoPaginacion">...</complexType>
<complexType name="SOFinca">...</complexType>
<complexType name="SOItem">...</complexType>
<complexType name="SOEcotopo">...</complexType>
<complexType name="SOAerofoto">...</complexType>
<complexType name="SOInfoGeneral">...</complexType>
<complexType name="SORespuestaWS">...</complexType>
</schema>
感謝所有幫助