You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Anto <an...@gmail.com> on 2010/06/28 12:18:18 UTC

Changing operation in ServiceMix CXF consumer --> provider

Hi,

    When routing from ServiceMix CXF-BC consumer to ServiceMix CXF-BC
provider, need to call a different operation of CXF provider web service.
The application uses ServiceMix and Camel JBI component. Camel is used for
routing purpose only. The route is

CXF BC consumer ----> Camel ----> CXF BC provider

For example 

operation: {http://example.org}hello

changed to

operation: {http://example.org}greet

I tried to set operation as a header in camel route but is not working.

<route>
    <from uri="jbi:service:http://example.org/helloRouteBuilder"/>
    <setHeader headerName="operationName">
        <constant>greet</constant>
    </setHeader>
    <to uri="jbi:service:http://example.org/greetingService"/>
</route>

I know that this syntax is for Camel CXF endpoints. Will it work for
ServiceMix CXF components?

Anto
-- 
View this message in context: http://camel.465427.n5.nabble.com/Changing-operation-in-ServiceMix-CXF-consumer-provider-tp511639p511639.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Changing operation in ServiceMix CXF consumer --> provider

Posted by Anto <an...@gmail.com>.
Thanks. I used the second option which can be used in conjunction with
conditions to change operation based on incoming operation.

Anto
-- 
View this message in context: http://camel.465427.n5.nabble.com/Changing-operation-in-ServiceMix-CXF-consumer-provider-tp511639p668771.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Changing operation in ServiceMix CXF consumer --> provider

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

There are two ways to handle this with servicemix-camel.

Option 1: the JBI operation is conveyed in the Camel Exchange in an
exchange header called 'JbiOperation' (value of the
JbiBinding.OPERATION constant) so you could override that header value
in your route -- the value should be your operation QName.  In Java
code, it would look like this
    exchange.setProperty(JbiBinding.OPERATION, new
QName("http://example.org", "greet"))

Option 2: the easier solution would be to just append the target
operation to the endpoint URI, e.g. you could use <to
uri="jbi:service:http://example.org/greetingService?operation={http://example.org}greet"/>
to override the incoming operation while sending the Exchange to the
greetService endpoint.

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



On 28 June 2010 12:18, Anto <an...@gmail.com> wrote:
>
> Hi,
>
>    When routing from ServiceMix CXF-BC consumer to ServiceMix CXF-BC
> provider, need to call a different operation of CXF provider web service.
> The application uses ServiceMix and Camel JBI component. Camel is used for
> routing purpose only. The route is
>
> CXF BC consumer ----> Camel ----> CXF BC provider
>
> For example
>
> operation: {http://example.org}hello
>
> changed to
>
> operation: {http://example.org}greet
>
> I tried to set operation as a header in camel route but is not working.
>
> <route>
>    <from uri="jbi:service:http://example.org/helloRouteBuilder"/>
>    <setHeader headerName="operationName">
>        <constant>greet</constant>
>    </setHeader>
>    <to uri="jbi:service:http://example.org/greetingService"/>
> </route>
>
> I know that this syntax is for Camel CXF endpoints. Will it work for
> ServiceMix CXF components?
>
> Anto
> --
> View this message in context: http://camel.465427.n5.nabble.com/Changing-operation-in-ServiceMix-CXF-consumer-provider-tp511639p511639.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>