我正在尝试共同连接到第 3 方 SOAP Web 服务。似乎该服务可以在 HTTP 时工作SOAPAction header 是一个空字符串 ("")。这是 wsdl 的片段:
<wsdl:binding name="detailsRequestMessage" type="tns:UssdPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="details">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
您在哪里看到 soapAction=""
我使用 Axis2 (1.5) wsdl2java 生成了一个 stub 。
我是 希望获得以下内容(使用 SoapUI 运行时的成功输出):
POST /details HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: some.host
Content-Length: 323
但是相反 我正进入(状态:
POST /details HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://some.url/wsussd/ussdtypes/UssdPortType/detailsRequest"
User-Agent: Axis2
Host: some.host
Content-Length: 300
有没有人知道问题是什么或者我如何在程序中设置soapAction。
谢谢,
罗宁
最佳答案
rperez 对他的回答并不完全清楚。
我找到了 https://issues.apache.org/jira/browse/AXIS2-4264声称该问题已在 1.6.0 中修复,但我在 1.6.2 中仍有问题
但是,这确实有效:
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.Constants.Configuration.DISABLE_SOAP_ACTION, true);
关于web-services - 设置 SOAPAction HTTP header 时的 Axis2 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1525306/