You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rafal Janik <ra...@softwaremind.pl> on 2011/07/15 13:25:14 UTC

jbi:service in camel route problem

Hi,

I'm trying to write a invocation of  external ws service in jbi (apache 
servicemix) using camel.

The RouteBuilder.java :

         from("timer://tutorial?fixedRate=true&delay=4000&period=10000")
             .setBody(constant(msg))
             
.to("jbi:service:http://externalservice.com/Annotation?operation={http://externalservice.com/ws/types}annotateString&mep=in-out")
             .to("log:my-test-ws-execution");

and a msg is a proper soap message (works in soapui)


in logs I can find :

"Could not find route for exchange:"

Am I doing it wrong with the camel part ?


Fuse ESB 3.6 with camel-core 2.7.1

Re: jbi:service in camel route problem

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Cxf bc provider can extract operation name from your input payload  
automatically, as long as your payload is correct per the wsdl, so  
generally you needn't specify the operation in uri.
And about the to jbi uri, take a look at [1] to get more details, per  
your wsdl and service in cxf bc provider, it should be

to("jbi:endpoint:http://my.service.com/prototype/Annotation/cxfbc-provider-endpoint
[1]http://camel.apache.org/jbi.html

Freeman
On 2011-7-15, at 下午9:17, Rafal Janik wrote:

> Hi Freeman,
>
> Thanks a lot for your reply.
>
> So I have cxfbc provider
>
>    xmlns:service="http://my.service.com/prototype"
>    ...
> <cxfbc:provider wsdl="classpath:annotation.wsdl"
>        service="service:Annotation"
>        endpoint="cxfbc-provider-endpoint" />
>
> And the xmlns:service is the same as in wsdl targetNamespace:
>
> <wsdl:definitions name="TWebService" targetNamespace="http://my.service.com/prototype 
> " ...>
> <wsdl:types>
> <xs:schema attributeFormDefault="unqualified"  
> elementFormDefault="qualified" targetNamespace="http://my.service.com/prototype/types 
> " ...>
>
>
> As I understand values of 'service' and 'endpoint' are my names for  
> created endpoint...
>
> So how should look the camel to() in this case invoking  
> annotateMethod ?
>
> I know the following example is wrong but I have still problem with  
> understanding it :/ :
>
> .to("jbi:endpoint:http://my.service.com/prototype/Annotation/cxfbc-provider-endpoint?operation= 
> {http://my.service.com/prototype/types}annotateMethod")
>
> and get following error :
>
> Could not find definition for service Annotation
>
>
>
>
> W dniu 15.07.2011 13:46, Freeman Fang pisze:
>>
>> On 2011-7-15, at 下午7:25, Rafal Janik wrote:
>>
>>>
>>> Hi,
>>>
>>> I'm trying to write a invocation of  external ws service in jbi  
>>> (apache servicemix) using camel.
>>>
>>> The RouteBuilder.java :
>>>
>>>       from("timer://tutorial? 
>>> fixedRate=true&delay=4000&period=10000")
>>>           .setBody(constant(msg))
>>>           .to("jbi:service:http://externalservice.com/Annotation?operation= 
>>> {http://externalservice.com/ws/types}annotateString&mep=in-out")
>>>           .to("log:my-test-ws-execution");
>>>
>> Hi,
>> Here you have .to("jbi:service:http://externalservice.com/Annotation?operation= 
>> {http://externalservice.com/ws/types}annotateString&mep=in-out"),  
>> which means you need a JBI provider endpoint as target, do you  
>> deploy that JBI provider endpoint? You need deploy a cxf bc  
>> provider endpoint here.
>>
>> Freeman
>>> and a msg is a proper soap message (works in soapui)
>>>
>>>
>>> in logs I can find :
>>>
>>> "Could not find route for exchange:"
>>>
>>> Am I doing it wrong with the camel part ?
>>>
>>>
>>> Fuse ESB 3.6 with camel-core 2.7.1
>>
>> ---------------------------------------------
>> Freeman Fang
>>
>> FuseSource
>> Email:ffang@fusesource.com
>> Web: fusesource.com
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: jbi:service in camel route problem

Posted by Rafal Janik <ra...@softwaremind.pl>.
Hi Freeman,

Thanks a lot for your reply.

So I have cxfbc provider

     xmlns:service="http://my.service.com/prototype"
     ...
<cxfbc:provider wsdl="classpath:annotation.wsdl"
         service="service:Annotation"
         endpoint="cxfbc-provider-endpoint" />

And the xmlns:service is the same as in wsdl targetNamespace:

<wsdl:definitions name="TWebService" 
targetNamespace="http://my.service.com/prototype" ...>
<wsdl:types>
<xs:schema attributeFormDefault="unqualified" 
elementFormDefault="qualified" 
targetNamespace="http://my.service.com/prototype/types" ...>


As I understand values of 'service' and 'endpoint' are my names for 
created endpoint...

So how should look the camel to() in this case invoking annotateMethod ?

I know the following example is wrong but I have still problem with 
understanding it :/ :

.to("jbi:endpoint:http://my.service.com/prototype/Annotation/cxfbc-provider-endpoint?operation={http://my.service.com/prototype/types}annotateMethod")

and get following error :

  Could not find definition for service Annotation




W dniu 15.07.2011 13:46, Freeman Fang pisze:
>
> On 2011-7-15, at 下午7:25, Rafal Janik wrote:
>
>>
>> Hi,
>>
>> I'm trying to write a invocation of  external ws service in jbi 
>> (apache servicemix) using camel.
>>
>> The RouteBuilder.java :
>>
>>        from("timer://tutorial?fixedRate=true&delay=4000&period=10000")
>>            .setBody(constant(msg))
>>            
>> .to("jbi:service:http://externalservice.com/Annotation?operation={http://externalservice.com/ws/types}annotateString&mep=in-out") 
>>
>>            .to("log:my-test-ws-execution");
>>
> Hi,
> Here you have 
> .to("jbi:service:http://externalservice.com/Annotation?operation={http://externalservice.com/ws/types}annotateString&mep=in-out"), 
> which means you need a JBI provider endpoint as target, do you deploy 
> that JBI provider endpoint? You need deploy a cxf bc provider endpoint 
> here.
>
> Freeman
>> and a msg is a proper soap message (works in soapui)
>>
>>
>> in logs I can find :
>>
>> "Could not find route for exchange:"
>>
>> Am I doing it wrong with the camel part ?
>>
>>
>> Fuse ESB 3.6 with camel-core 2.7.1
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
>
>
>
>
>
>
>
>
>
>




Re: jbi:service in camel route problem

Posted by Freeman Fang <fr...@gmail.com>.
On 2011-7-15, at 下午7:25, Rafal Janik wrote:

>
> Hi,
>
> I'm trying to write a invocation of  external ws service in jbi  
> (apache servicemix) using camel.
>
> The RouteBuilder.java :
>
>        from("timer://tutorial?fixedRate=true&delay=4000&period=10000")
>            .setBody(constant(msg))
>            .to("jbi:service:http://externalservice.com/Annotation?operation= 
> {http://externalservice.com/ws/types}annotateString&mep=in-out")
>            .to("log:my-test-ws-execution");
>
Hi,
Here you have .to("jbi:service:http://externalservice.com/Annotation?operation= 
{http://externalservice.com/ws/types}annotateString&mep=in-out"),  
which means you need a JBI provider endpoint as target, do you deploy  
that JBI provider endpoint? You need deploy a cxf bc provider endpoint  
here.

Freeman
> and a msg is a proper soap message (works in soapui)
>
>
> in logs I can find :
>
> "Could not find route for exchange:"
>
> Am I doing it wrong with the camel part ?
>
>
> Fuse ESB 3.6 with camel-core 2.7.1

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com