You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jens <sm...@dzbank.de> on 2012/09/12 16:23:15 UTC

Setting properties on Camel CXF consumer endpoints

Hi,

I have a simple bridging route defined as



The toBean has a WS-Policy attached that demands a UsernameToken.

As per the CXF documentation I try to set the username and password on the
toBean like this:



However, it seems those properties are simply discarded, and the CXF Policy
Interceptor complains:
"No username available."

That also seems to be true for arbitrary properties. If I set the properties
on the toBean instead, they do seem to be applied there (which isn't helping
in this case, but anyway). Is there a reason why unknown properties are
swallowed on the consumer side? Is there a way to avoid that?

Thanks,
Jens



--
View this message in context: http://camel.465427.n5.nabble.com/Setting-properties-on-Camel-CXF-consumer-endpoints-tp5719195.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Setting properties on Camel CXF consumer endpoints

Posted by Jens <sm...@dzbank.de>.
Hm, another try, this time with the XML escaped...

I have a simple bridging route defined as

      [from uri="cxf:bean:fromBean"/]
      [to uri="cxf:bean:toBean"/]

The toBean has a WS-Policy attached that demands a UsernameToken.

As per the CXF documentation I try to set the username and password on the
toBean like this:

  [cxf:cxfEndpoint id="toBean" ...]
    ...
    [cxf:properties]
      [entry key="ws-security.username" value="user"/]
      [entry key="ws-security.password" value="password"/]
    [/cxf:properties]
  [/cxf:cxfEndpoint]

This works when I use it on a plain CXF endpoint (ie. no Camel involved).
With a Camel CXF endpoint, however, it seems those properties are simply
discarded, and the CXF Policy Interceptor complains when trying to create
the UsernameToken: "No username available."

That also seems to be true for arbitrary properties. If I set the properties
on the fromBean instead, they do seem to be applied there (which isn't
helping in this case, but anyway). Is there a reason why unknown properties
are just swallowed on the consumer side? Is there a way to have them applied
anyway? I'm currently working around this by setting headers on the route
which do get propagated to endpoint properties but that's somewhat less than
ideal.

Thanks,
Jens



--
View this message in context: http://camel.465427.n5.nabble.com/Setting-properties-on-Camel-CXF-consumer-endpoints-tp5719195p5719259.html
Sent from the Camel - Users mailing list archive at Nabble.com.