Hello, 

We have configured the WS-Addressing policy in the wsdl.

  <wsdl:service name="CRMServiceProvider">
    <wsdl:port binding="tns:localhostBinding" name="CRMServicePort">
      <soap:address location="http://localhost:8888/soap/CRMServiceProvider/"/>
            <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy";>
                <wsam:Addressing 
xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata";>
                    <wsp:Policy/>
                </wsam:Addressing>
            </wsp:Policy>
    </wsdl:port>
  </wsdl:service>

Add the policy attachment used in the application like this: 

<attachments xmlns:wsp="http://www.w3.org/ns/ws-policy"; 
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
    <wsp:PolicyAttachment>
        <wsp:AppliesTo>
            <wsa:EndpointReference>
                
<wsa:Address>http://localhost:8040/services/CRMServiceProvider</wsa:Address>
            </wsa:EndpointReference>
        </wsp:AppliesTo>
        <wsp:Policy>
            <wsam:Addressing 
xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata";>
                <wsp:Policy/>
            </wsam:Addressing>
        </wsp:Policy>
    </wsp:PolicyAttachment>    
</attachments>

When this service deployed and get invoked, the exception thrown out: 

Caused by: org.apache.cxf.binding.soap.SoapFault: A required header 
representing a Message Addressing Property is not present
        at 
org.apache.cxf.ws.policy.PolicyVerificationInInterceptor.handle(PolicyVerificationInInterceptor.java:109)
        at 
org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:45)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
        at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:801)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1627)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1494)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1402)
        at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649)
        at 
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSende
rInterceptor.java:62)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:535)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:465)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:368)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:321)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
        ... 47 more

If adding the addressing feature into the beans.xml: 
<jaxws:endpoint id="CRMService" ... 
    <jaxws:features>
        <wsa:addressing xmlns:wsa="http://cxf.apache.org/ws/addressing"/>
    </jaxws:features>
</jaxws:endpoint>

Then, it works ok!

Does the configured WS-Addressing policy still require the WSAddressingFeature 
enabled?

Thanks.
Xilai

Reply via email to