Android中没有SOAPAction标题的问题

Android中没有SOAPAction标题的问题,android,soap,header,Android,Soap,Header,我需要一些帮助。 我无法通过安卓系统访问我的网络服务 我正在使用KSoap2 3.0.0,我正在使用android冰淇淋三明治4.0.3(API 15) 当我呼叫服务时,我得到以下响应: <faultstring>no SOAPAction header!</faultstring> 我展示了wsdl代码的第一部分: <wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmln

我需要一些帮助。 我无法通过安卓系统访问我的网络服务

我正在使用KSoap2 3.0.0,我正在使用android冰淇淋三明治4.0.3(API 15)

当我呼叫服务时,我得到以下响应:

<faultstring>no SOAPAction header!</faultstring>
我展示了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>

...
...
...
...
...
...
...
...
...
谢谢你的帮助

上面代码中的两行将创建一个空元素,如

<></>
现在你什么时候打电话

envelope.headerOut = headers;
它将用这个空元素替换soap头

如果您想发送空标题,则可以按如下方式发送

   Element [] headers = new Element[1];
   headers[0]=new Element();
就这样,现在开始通话

envelope.headerOut = headers;
它将创建空的soap头,如

<soap:header></soap:header>

如果您想在这个标题中添加几个节点,请告诉我您的标题格式,我可以为您提供相应的代码

   Element [] headers = new Element[1];
   headers[0]=new Element();
envelope.headerOut = headers;
<soap:header></soap:header>