2

我的网络服务在其WSDL中定义了一个 WS 寻址策略

<wsp:Policy wss:Id="WSAddressing_policy"
      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
      xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
      xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
    <wsam:Addressing>
        <wsp:policy/>
    </wsam:Addressing>
</wsp:Policy>

... 和

  <wsdl:binding name="OutboundBinding" type="tns:OutboundPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsp:PolicyReference URI="#WSAddressing_policy"/>
       <!-- Verify Availability -->        
        <wsdl:operation name="VerifyAvailability">
            <soap:operation soapAction="" style="document"/>
            <wsdl:input name="VerifyAvailabilityRequest">
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="VerifyAvailabilityResponse">
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

我对策略使用CXFs自动拦截器:

<cxf:bus>
    <cxf:features>
        <p:policies ignoreUnknownAssertions="true"/>
        <cxf:logging/>
    </cxf:features>
</cxf:bus>

现在我无法使用 SOAP UI 创建对此 Web 服务的有效请求 - 无论我尝试哪种 WS-A 设置,我总是得到以下响应:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing">ns1:MessageAddressingHeaderRequired</faultcode>
         <faultstring>A required header representing a Message Addressing Property is not present</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

我究竟做错了什么?

更新

我也无法使用 CXF 客户端本身创建有效请求。如果我将 WSDL 从

<wsp:Policy wss:Id="WSAddressing_policy">
    <wsam:Addressing>
        <wsp:policy/>
    </wsam:Addressing>
</wsp:Policy>

    <wsp:Policy wss:Id="WSAddressing_policy">
        <wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="false" />
    </wsp:Policy>
4

1 回答 1

0

似乎寻址元数据命名空间目前是 CXF 的问题。我提交了一份错误报告。使用

xmlns:wsam="http://www.w3.org/2007/0 2 /addressing/metadata" 而不是 xmlns:wsam="http://www.w3.org/2007/0 5 /addressing/metadata"解决问题。

于 2015-09-23T17:33:06.280 回答