Hi,

Basically there are two a bit different ways to resolve that:
a) Integrate Camel Transport into CXF using "camel" protocol (like 
camel://direct:MyEndpointName). See details in 
http://camel.apache.org/camel-transport-for-cxf.html and example 
http://camel.apache.org/cxf-example.html .
b) Use CXF Camel component. See details in http://camel.apache.org/cxf.html .

Option (a) allows you to call Camel routes and use camel endpoints for CXF 
service, option (b) allows to expose Camel routes as CXF services and call 
external services using CXF clients.
What option you use depends on your use case.

See some comments inline:
 
> -----Original Message-----
> From: Lopez, Scott [mailto:[email protected]]
> Sent: Montag, 14. April 2014 18:27
> To: [email protected]
> Subject: cxf:cxfEndpoint and ws-securitypolicy
> 
> I'm using camel-cxf to transport messages.  These messages need to be
> secured from end to end.
> 
> It doesn't appear that jaxws:endpoint is an option, I get an exception
> 
> SoapTransportFactory.getDestination(SoapTransportFactory.java:142)
> 
> Looking at the code it appears that this null pointer occurs when something
> besides http:// and jms:// are used.
> 

Likely you have no camel transport component in your classpath.

> I want to use camel due to transaction support that I understand is not 
> available
> in CXF 2.7.7

It depends on what kind of transactions you need for your case: you can 
implement transaction aware code in service business logic, for example for DB 
access. Additionally CXF supports transaction for JMS transport.

> 
> I have also tried using the cxf:cxfEndpoint, when the request comes across and
> is read from the queue and is processed PolicyBasedWSS4JInInterceptor.  I
> don't want it to process the username/password, this needs to be left to 
> karaf.
> 
> <camelcxf:properties>
>   <entry key="ws-security.validate.token" value="false" />
> </camelcxf:properties>
> 
> This property is ignored and I get an error about authentication.
> 
> So my questions are as follows:
> 
> 
> 1.       How can I get the policy interceptor to recognize this property.  
> I've seen
> examples where it should but when I follow those examples it doesn't get
> noticed.

I would say the simplest way to activate the ws-policy is to attach it to wsdl 
and provide wsdlURL attribute in camel cxf component.

> 
> 2.       Can I override the policy interceptor?  When I try to do this it 
> appears
> that the policy interceptor is run before my interceptor can execute.  Is 
> there a
> way to disable the automatic execution and have it as a been in the
> cxf:inInterceptors section

You can put your interceptor in early phase or use getBefore() statement.
To disable interceptor execution you can remove it from interceptors chain:
  SackedIntereptor sacked = new SackedIntereptor();
  InterceptorChain chain = message.getInterceptorChain();
  chain.remove(sacked);

However you should really be aware what you do, because it can seriously affect 
service security.

> 
> 3.       I also tried to define this on the bus without success using
> <cxf:bus>....</cxf:bus>

I did not get completely what you want to achieve here.

> 
> Any ideas are greatly appreciated.

Regards,
Andrei.

Reply via email to