It is fine to create a property for default operation to be invoke

On 06/02/2010 12:00 AM, Claus Ibsen wrote:
On Tue, Jun 1, 2010 at 8:40 PM, Jon Anstey<[email protected]>  wrote:
You just have to set the operationName header before invoking the CXF
endpoint. Something like this if you want to do this within a route:

...
      <setHeader headerName="operationName">
        <constant>myOperation</constant>
      </setHeader>
      <to uri="cxf:bean:myCXFEndpointBeanWith2Operations"/>
...

Btw why can't you set the operationName on the endpoint uri directly as well?
Just as you can use the method parameter on the bean endpoint.

       <to 
uri="cxf:bean:myCXFEndpointBeanWith2Operations?operationName=fooMethod"/>

And CXF ought to throw an ambiguous exception in case it cannot pick
the method, just as the bean component would do.

A endpoint can support 10 operations all with different arguments. I'd say it is a best practice to always set the operationName header so you are sure which operation you are calling. Adding a default operation property in the URI is probably a good idea.


On Tue, Jun 1, 2010 at 4:01 PM, Carlo Camerino<[email protected]>wrote:

Hi,

how do you specify the operation which camel will use.
In the documentation, you can specify the service name and the port name
but
you can't specify the operation.

i have two operations with the same type of arguments.
camel seems to choose one but i don't know how camel is choosing it.

thanks
carlo



--
Cheers,
Jon

Camel in Action: http://manning.com/ibsen
Blog: http://janstey.blogspot.com



Reply via email to