web-services - 设置 SOAPAction HTTP header 时的 Axis2 问题

标签 web-services axis2

我正在尝试共同连接到第 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/

相关文章:

web-services - 将外部目录映射到 web.xml

java - 如何在 Axis2 客户端中正确使用 WS-Addressing?

wsdl - Axis wsdl 生成

xsd - 如何自定义 axis2 生成的 xsd

java - 在 gllashfish 上手动部署 java web 服务

asp.net - Web 服务中的 ThreadPool.QueueUserWorkItem 用于 “Fire and Forget” 任务

web-services - javax.xml.ws.WebServiceException : Unable to create JAXBContext

java - 尝试调用 Web 服务调用时访问被拒绝

java - wsdl2java 在没有服务的情况下使用 Apache Axis2 for WSDL

Java SQL JDBC 错误 - 带有 Soap 消息