2
我的web服務定義WS在其WSDL解決政策與如何建立一個有效的WS-A與SOAP UI請求
<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>
現在我無法創建一個有效的請求此WebService與SOAP UI - 我總是得到如下回應,不管我嘗試它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客戶端本身就是一個有效的請求。我設法得到它的工作,如果我從
<wsp:Policy wss:Id="WSAddressing_policy">
<wsam:Addressing>
<wsp:policy/>
</wsam:Addressing>
</wsp:Policy>
改變WSDL來
<wsp:Policy wss:Id="WSAddressing_policy">
<wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="false" />
</wsp:Policy>