Web Services WS消耗时发生SOAPAction错误

thtygnil  于 2022-12-13  发布在  其他
关注(0)|答案(1)|浏览(145)

我正在尝试使用SOAPRequest节点从IBMIntegrationBus v10查询WS。
SoapUI使用具有以下负载的此WS没有问题:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsg="http://wsgetrama.wsbeans.iseries/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soapenv:Header/>
   <soapenv:Body>
      <out:wsgetrama xmlns:out="http://wsgetrama.wsbeans.iseries/">
         <arg0>
            <PERAMA>1</PERAMA>
            <PERAMD>Test</PERAMD>
         </arg0>
      </out:wsgetrama>
   </soapenv:Body>
</soapenv:Envelope>

原始数据如下:

POST http://192.168.1.116:10028/web/services/WSGETRAMAService/WSGETRAMA HTTP/1.1
Accept-Encoding: gzip,deflate   
Content-Type: text/xml;charset=UTF-8   
SOAPAction: ""   
Content-Length: 643   
Host: 192.168.1.116:10028   
Connection: Keep-Alive   
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

我正在尝试使用具有以下WSDL的WS:

<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://wsgetrama.wsbeans.iseries/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="WSGETRAMA" targetNamespace="http://wsgetrama.wsbeans.iseries/">
<types>
<xs:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://wsgetrama.wsbeans.iseries/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wsgetrama.wsbeans.iseries/" version="1.0">
<xs:element name="wsgetrama" type="tns:wsgetrama"/>
<xs:element name="wsgetramaResponse" type="tns:wsgetramaResponse"/>
<xs:complexType name="wsgetrama">
<xs:sequence>
<xs:element name="arg0" type="tns:wsgetramaInput"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="wsgetramaInput">
<xs:sequence>
<xs:element name="PERAMA" type="xs:decimal"/>
<xs:element name="PERAMD" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="wsgetramaResponse">
<xs:sequence>
<xs:element name="return" type="tns:wsgetramaResult"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="wsgetramaResult">
<xs:sequence>
<xs:element name="PERAMD" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name="wsgetrama">
<part element="tns:wsgetrama" name="parameters"></part>
</message>
<message name="wsgetramaResponse">
<part element="tns:wsgetramaResponse" name="parameters"></part>
</message>
<portType name="WSGETRAMAServices">
<operation name="wsgetrama">
<input message="tns:wsgetrama" wsam:Action="http://wsgetrama.wsbeans.iseries/WSGETRAMAServices/wsgetramaRequest"></input>
<output message="tns:wsgetramaResponse" wsam:Action="http://wsgetrama.wsbeans.iseries/WSGETRAMAServices/wsgetramaResponse"></output>
</operation>
</portType>
<binding name="WSGETRAMAServicesPortBinding" type="tns:WSGETRAMAServices">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="wsgetrama">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="WSGETRAMA">
<port binding="tns:WSGETRAMAServicesPortBinding" name="WSGETRAMAServicesPort">
<soap:address location="http://192.168.1.116:10028/web/services/WSGETRAMAService/WSGETRAMA"/>
</port>
</service>
</definitions>

虽然SoapUI使用它没有问题,但当我在集成总线上尝试使用它时,我得到以下错误:
给定的SOAPAction wsgetrama与操作不匹配
为了使用这个WS,我导入了前面提到的WSDL,并基于它创建了SOAPRequest节点。
任何想法将不胜感激!
谢谢!肖恩

p1tboqfb

p1tboqfb1#

我也遇到了同样的问题。我尝试从IBM Integration Bus消息流使用jboss EAP 6.2中公开的Web服务,并且我收到了同样的消息(服务没有响应,查看server.log时我注意到同样的错误“给定的SOAPAction generarDocumento不匹配操作”)。
wsdl确实包含一个空的soapaction:

<wsdl:operation name="generarDocumento">
    <soap:operation soapAction="" style="document"/>
    <wsdl:input name="generarDocumento">
        <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="generarDocumentoResponse">
        <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="ControladaException">
        <soap:fault name="ControladaException" use="literal"/>
    </wsdl:fault>
</wsdl:operation>

几个小时后,我在IBM知识库中发现了以下内容:
“如果SOAPAction在HTTPInput标头中设置为空字符串,则它将被覆盖,除非该操作在HTTPRequest标头中显式设置,例如:

SET OutputRoot.HTTPRequestHeader.SOAPAction =   InputRoot.HTTPInputHeader.SOAPAction


我使用的是JavaCompute节点,因此我仍在研究如何将上面的ESQL代码转换为Java,以便替换HTTP请求并将soapaction设置为空。
如果我成功了我会告诉你们的。

相关问题