2

My webservice defines a WS Addressing policy in its WSDL with

<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>

... and

  <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>

I use CXFs automatic interceptors for policies:

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

Now I'm unable to create a valid request to this webservice with SOAP UI - I always get the following response, regardless which WS-A settings I try:

<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>

What am I doing wrong?

Update

I'm also unable to create a valid request using a CXF Client itself. I managed to get it working if I change the WSDL from

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

to

    <wsp:Policy wss:Id="WSAddressing_policy">
        <wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="false" />
    </wsp:Policy>
Stefan K.
  • 7,701
  • 6
  • 52
  • 64

1 Answers1

0

It seems the addressing metadata namespace is currently the problem for CXF. I filed a bugreport. Using

xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata" instead of xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" solves the problem.

Stefan K.
  • 7,701
  • 6
  • 52
  • 64