2013-09-26 138 views
0

我有两个操作JBoss的5.1 Web服务
这两种操作采取相同的同一请求类型
每个都有它自己的行动
的web服务,编译和部署精细,但当我尝试并提交与soapUI的请求,我得到了以下错误:
无法唯一indentify操作:{} https://garygateway.quinn.co.za/services/garygateway GaryRequest无法唯一indentify操作

这里是我的WSDL

<definitions name='GaryGatewayService' targetNamespace='https://garygateway.mediswitch.co.za/services/garygateway' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='https://garygateway.quinn.co.za/services/garygateway' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='https://garygateway.mediswitch.co.za/services/garygateway' xmlns:xsd='http://www.w3.org/2001/XMLSchema'> 
<types> 
    <xs:schema targetNamespace='https://garygateway.quinn.co.za/services/garygateway' version='1.0' xmlns:ns1='https://garygateway.mediswitch.co.za/services/garygateway' xmlns:xs='http://www.w3.org/2001/XMLSchema'> 
    <xs:import namespace='https://garygateway.mediswitch.co.za/services/garygateway'/> 
    <xs:element name='GaryRequest' nillable='true' type='ns1:garyRequest'/> 
    <xs:element name='GaryResponse' nillable='true' type='ns1:garyResponse'/> 
    </xs:schema> 
    <xs:schema targetNamespace='https://garygateway.mediswitch.co.za/services/garygateway' version='1.0' xmlns:xs='http://www.w3.org/2001/XMLSchema'> 
    <xs:complexType name='garyRequest'> 
    <xs:sequence> 
    <xs:element minOccurs='0' name='id' type='xs:string'/> 
    <xs:element minOccurs='0' name='name' type='xs:string'/> 
    <xs:element minOccurs='0' name='surname' type='xs:string'/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name='garyResponse'> 
    <xs:sequence> 
    <xs:element minOccurs='0' name='message' type='xs:string'/> 
    <xs:element minOccurs='0' name='status' type='xs:string'/> 
    </xs:sequence> 
    </xs:complexType> 
    </xs:schema> 
</types> 
<message name='GaryGatewayEndpoint_requestOneResponse'> 
    <part element='ns1:GaryResponse' name='GaryResponse'></part> 
</message> 
<message name='GaryGatewayEndpoint_requestTwoResponse'> 
    <part element='ns1:GaryResponse' name='GaryResponse'></part> 
</message> 
<message name='GaryGatewayEndpoint_requestTwo'> 
    <part element='ns1:GaryRequest' name='requestTwo'></part> 
</message> 
<message name='GaryGatewayEndpoint_requestOne'> 
    <part element='ns1:GaryRequest' name='requestOne'></part> 
</message> 
<portType name='GaryGatewayEndpoint'> 
    <operation name='requestOne' parameterOrder='requestOne'> 
    <input message='tns:GaryGatewayEndpoint_requestOne'></input> 
    <output message='tns:GaryGatewayEndpoint_requestOneResponse'></output> 
    </operation> 
    <operation name='requestTwo' parameterOrder='requestTwo'> 
    <input message='tns:GaryGatewayEndpoint_requestTwo'></input> 
    <output message='tns:GaryGatewayEndpoint_requestTwoResponse'></output> 
    </operation> 
</portType> 
<binding name='GaryGatewayEndpointBinding' type='tns:GaryGatewayEndpoint'> 
    <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/> 
    <operation name='requestOne'> 
    <soap:operation soapAction='https://garygateway.quinn.co.za/services/garygateway/requestOne'/> 
    <input> 
    <soap:body use='literal'/> 
    </input> 
    <output> 
    <soap:body use='literal'/> 
    </output> 
    </operation> 
    <operation name='requestTwo'> 
    <soap:operation soapAction='https://garygateway.quinn.co.za/services/garygateway/requestTwo'/> 
    <input> 
    <soap:body use='literal'/> 
    </input> 
    <output> 
    <soap:body use='literal'/> 
    </output> 
    </operation> 
</binding> 
<service name='GaryGatewayService'> 
    <port binding='tns:GaryGatewayEndpointBinding' name='GaryGatewayEndpointPort'> 
    <soap:address location='http://gary-desktop:8480/wsgateway/GaryGateway'/> 
    </port> 
</service> 
</definitions> 

我启用了WS-A解决,这使得SOAP消息头是这样的:

<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>https://garygateway.mediswitch.co.za/services/garygateway/GaryGatewayEndpoint/requestOneRequest</wsa:Action></soapenv:Header> 

这里同时通过SoapU产生的标题:

POST /wsgateway/GaryGateway HTTP/1.1 
Accept-Encoding: gzip,deflate 
Content-Type: text/xml;charset=UTF-8 
SOAPAction: "https://garygateway.quinn.co.za/services/garygateway/GaryGatewayEndpoint/requestOneRequest" 
Content-Length: 544 
Host: gary-desktop:8480 
Connection: Keep-Alive 
User-Agent: Apache-HttpClient/4.1.1 (java 1.5) 

不过还是我收到不能唯一indentify操作错误

以下是完整的响应:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> 
    <env:Header/> 
    <env:Body> 
     <env:Fault> 
     <faultcode>env:Server</faultcode> 
     <faultstring>Cannot uniquely indentify operation: {https://garygateway.quinn.co.za/services/garygateway}GaryRequest</faultstring> 
     </env:Fault> 
    </env:Body> 
</env:Envelope> 

回答

0

我必须启用网络服务上的寻址功能

@WebService(name = "", targetNamespace = "") 
@Addressing(enabled = true, required = true)