I am attempting to proxy calls to a service and centralize ws-secuity
handling within a camel route. Everything works perfectly but the
ws-secuirty headers arent being removed and are instead being propogated
down to the proxied service. This results in a MustUnderstand problem as
the proxied service is not setup to handle security.
This has to be a common scenario. Can someone give me a hint as to what
might be wrong?
The cxf endpoints are configured this way:
<camel-cxf:cxfEndpoint id="proxyUserService"
address="/proxy/userService"
endpointName="us:userSoapServicePort" serviceName="us:userSoapServicePorts"
wsdlURL="classpath:service/user-soap-v1.wsdl"
xmlns:us="urn:healthmedia:wsdl:user:soap:v1" >
<camel-cxf:properties>
<entry key="ws-security.ut.validator" value-ref="usernameValidator" />
<entry key="ws-security.callback-handler" value-ref="keyStoreCallback" />
<entry key="ws-security.signature.properties"
value="classpath:server-keystore.properties" />
<entry key="ws-security.encryption.username" value="serverAlias" />
<entry key="ws-security.signature.username" value="serverAlias" />
</camel-cxf:properties>
</camel-cxf:cxfEndpoint>
<camel-cxf:cxfEndpoint id="realUserService"
address="${user-service.url}"
endpointName="us:userSoapServicePort" serviceName="us:userSoapServicePorts"
wsdlURL="classpath:service/user-soap-v1.wsdl"
xmlns:us="urn:healthmedia:wsdl:user:soap:v1" />
And the route is configured this way:
<!-- http://fusesource.com/docs/esbent/7.1/camel_cxf/Proxying-Payload.html
<camel:camelContext>
<camel:propertyPlaceholder id="properties"
location="classpath:user-service.properties"/>
<camel:route>
<!-- CXF consumer using PAYLOAD format -->
<camel:from uri="cxf:bean:proxyUserService?dataFormat=PAYLOAD" />
<!-- log input received -->
<camel:to uri="log:input" />
<!-- Need to remove the http headers which could confuse the http endpoint
<camel:removeHeaders pattern="*" />
<!-- send proxied request to real web service -->
<camel:to uri="cxf:bean:realUserService?dataFormat=PAYLOAD" />
<!-- log answer from real web service -->
<camel:to uri="log:output" />
</camel:route>
</camel:camelContext>
Thanks in advance!
-Mike
handling within a camel route. Everything works perfectly but the
ws-secuirty headers arent being removed and are instead being propogated
down to the proxied service. This results in a MustUnderstand problem as
the proxied service is not setup to handle security.
This has to be a common scenario. Can someone give me a hint as to what
might be wrong?
The cxf endpoints are configured this way:
<camel-cxf:cxfEndpoint id="proxyUserService"
address="/proxy/userService"
endpointName="us:userSoapServicePort" serviceName="us:userSoapServicePorts"
wsdlURL="classpath:service/user-soap-v1.wsdl"
xmlns:us="urn:healthmedia:wsdl:user:soap:v1" >
<camel-cxf:properties>
<entry key="ws-security.ut.validator" value-ref="usernameValidator" />
<entry key="ws-security.callback-handler" value-ref="keyStoreCallback" />
<entry key="ws-security.signature.properties"
value="classpath:server-keystore.properties" />
<entry key="ws-security.encryption.username" value="serverAlias" />
<entry key="ws-security.signature.username" value="serverAlias" />
</camel-cxf:properties>
</camel-cxf:cxfEndpoint>
<camel-cxf:cxfEndpoint id="realUserService"
address="${user-service.url}"
endpointName="us:userSoapServicePort" serviceName="us:userSoapServicePorts"
wsdlURL="classpath:service/user-soap-v1.wsdl"
xmlns:us="urn:healthmedia:wsdl:user:soap:v1" />
And the route is configured this way:
<!-- http://fusesource.com/docs/esbent/7.1/camel_cxf/Proxying-Payload.html
<camel:camelContext>
<camel:propertyPlaceholder id="properties"
location="classpath:user-service.properties"/>
<camel:route>
<!-- CXF consumer using PAYLOAD format -->
<camel:from uri="cxf:bean:proxyUserService?dataFormat=PAYLOAD" />
<!-- log input received -->
<camel:to uri="log:input" />
<!-- Need to remove the http headers which could confuse the http endpoint
<camel:removeHeaders pattern="*" />
<!-- send proxied request to real web service -->
<camel:to uri="cxf:bean:realUserService?dataFormat=PAYLOAD" />
<!-- log answer from real web service -->
<camel:to uri="log:output" />
</camel:route>
</camel:camelContext>
Thanks in advance!
-Mike