|
SOAPContextMapper's soapHeadersType attribute (
SWITCHYARD-710
) allows you to propagate WS-Security SOAP headers from a SOAP service binding to a SOAP reference binding:
<contextMapper includes=".*" soapHeadersType="XML"/>
|
However, when the reference binding is defined with WSDL that has a WS-Security Policy portion like the following one:
<binding name="ReverseServiceBinding" type="tns:ReverseService">
|
<wsp:PolicyReference URI="#ReverseServicePolicy"/>
|
...
|
</binding>
|
<wsp:Policy wsu:Id="ReverseServicePolicy">
|
<wsp:ExactlyOne>
|
<wsp:All>
|
<sp:SupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
|
<wsp:Policy>
|
<sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
|
<wsp:Policy>
|
<sp:WssUsernameToken10/>
|
</wsp:Policy>
|
</sp:UsernameToken>
|
</wsp:Policy>
|
</sp:SupportingTokens>
|
</wsp:All>
|
</wsp:ExactlyOne>
|
</wsp:Policy>
|
the reference fails to send a SOAP request raising the following warning:
15:01:40,139 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-/127.0.0.1:8080-1) Interceptor for {urn:switchyard-quickstart:camel-soap-proxy:1.0}ReverseService#{http://cxf.apache.org/jaxws/dispatch}Invoke has thrown exception, unwinding now: org.apache.cxf.ws.policy.PolicyException: No username available
|
at org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor.policyNotAsserted(AbstractTokenInterceptor.java:229) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
|
at org.apache.cxf.ws.security.wss4j.UsernameTokenInterceptor.addUsernameToken(UsernameTokenInterceptor.java:361) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
|
at org.apache.cxf.ws.security.wss4j.UsernameTokenInterceptor.addToken(UsernameTokenInterceptor.java:307) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
|
at org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor.handleMessage(AbstractTokenInterceptor.java:95) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
|
at org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor.handleMessage(AbstractTokenInterceptor.java:61) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
|
|