Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

WS-Policy support

$
0
0
I am trying to move all policy processing into the camel layer of my system
architecture. In order to do that I have setup an example proxy in front of
a cxf service and moved policy processing to the a bus configured for the
proxy:

<beans xmlns="http://www.springframework.org/schema/beans"
...
<p:externalAttachment location="classpath:policy/i18n-policy.xml"/>

<cxf:bus id="busStop">
<cxf:features>
<cxf:logging/>
<p:policies />
</cxf:features>
</cxf:bus>

<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:camelContext>
<camel:propertyPlaceholder id="properties"
location="classpath:user-service.properties"/>
<camel:endpoint id="realUserService"
uri="${user-service.url}?throwExceptionOnFailure=false"/>
<camel:route>
<camel:from uri="cxf:bean:proxyUserService?dataFormat=MESSAGE" />
<camel:to uri="log:input" />

<camel:removeHeaders pattern="CamelHttp*" />
<camel:to ref="realUserService" />
<camel:to uri="log:output" />
</camel:route>
</camel:camelContext>

</beans>

The policy is executed and the assertion fails when the appropriate headers
are not sent in the request. This is exactly what I would expect.

HOWEVER... despite the fact that the assertion fails the proxy forwards the
call onto the actual web service anyway (effectually allowing the caller to
bypass the ws-policy altogether).

Can someone offer me a hint as to why? Is there a limitation to I am unaware
of when I proxy calls in this way?

Thanks!

Viewing all articles
Browse latest Browse all 5648

Trending Articles