Example of request reply

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Example of request reply

xtof
Hello,

I'm quite new to Camel, and I'm trying to understand how implementing a gateway between 2 Web Services. It requires to implement a request-reply mechanism but I cannot find any example.
Could you help?

Thank.
Christophe
Reply | Threaded
Open this post in threaded view
|

Re: Example of request reply

Willem.Jiang
Administrator
Hi ,
I am working on camel-cxf component which will help you to do some
router work between 2 Web Services. My big patch just been applied in
the trunk, you can take a look at the unit test of camel-cxf component.
https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java
I will add a Web Service router example some time this week  :)

Willem.
xtof wrote:

> Hello,
>
> I'm quite new to Camel, and I'm trying to understand how implementing a
> gateway between 2 Web Services. It requires to implement a request-reply
> mechanism but I cannot find any example.
> Could you help?
>
> Thank.
> Christophe
>  

Reply | Threaded
Open this post in threaded view
|

Re: Example of request reply

Guillaume Nodet
Administrator
In reply to this post by xtof
Basically, if you write
  from("http://localhost:8080/myService").to("
http://remotehost:8080/targetService")
it should work.  Unfortuntately, the http component is not finished and it
won't write the response iirc.  But you can try with the http component
based on jakarta http core using
  from("jhc:http://localhost:8080/myService").to("jhc:
http://remotehost:8080/targetService")

On 9/18/07, xtof <[hidden email]> wrote:

>
>
> Hello,
>
> I'm quite new to Camel, and I'm trying to understand how implementing a
> gateway between 2 Web Services. It requires to implement a request-reply
> mechanism but I cannot find any example.
> Could you help?
>
> Thank.
> Christophe
> --
> View this message in context:
> http://www.nabble.com/Example-of-request-reply-tf4473066s22882.html#a12753590
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Example of request reply

Ravi116
In reply to this post by Willem.Jiang
Hi,
Is the web services example available now as part of snapshot download ?
I am new to camel and cxf. My simple use case is to publish a message to a active mq topic and have it route the message to a cxf web service. Here is the sample code below -

private static String serviceEndpointURI = "cxf://" + SERVICE_ADDRESS + "?" + SERVICE_CLASS + "&dataFormat=POJO";
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        context.addRoutes(new RouteBuilder() {

            public void configure() throws Exception {
                from("test-jms:queue:test.queue").to(serviceEndpointURI);
           }
        });
CamelTemplate template = new CamelTemplate(context);
context.start();
 for (int i = 0; i < 10; i++) {
            template.sendBody("test-jms:queue:test.queue", "Test Message: " + i);
 }
Thread.sleep(1000);
context.stop();

Will the code above work ?
Ravi




willem.jiang wrote
Hi ,
I am working on camel-cxf component which will help you to do some
router work between 2 Web Services. My big patch just been applied in
the trunk, you can take a look at the unit test of camel-cxf component.
https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java
I will add a Web Service router example some time this week  :)

Willem.
xtof wrote:
> Hello,
>
> I'm quite new to Camel, and I'm trying to understand how implementing a
> gateway between 2 Web Services. It requires to implement a request-reply
> mechanism but I cannot find any example.
> Could you help?
>
> Thank.
> Christophe
>  
Reply | Threaded
Open this post in threaded view
|

Re: Example of request reply

Willem.Jiang
Administrator
Hi,

Current CXF component sample POJO model shows your can invoke a
WebService with a method name and arguments list. You can find more
information about form the camel-cxf module's unit test[1] here.

[1]https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerTest.java

Willem.

Ravi116 wrote:

> Hi,
> Is the web services example available now as part of snapshot download ?
> I am new to camel and cxf. My simple use case is to publish a message to a
> active mq topic and have it route the message to a cxf web service. Here is
> the sample code below -
>
> private static String serviceEndpointURI = "cxf://" + SERVICE_ADDRESS + "?"
> + SERVICE_CLASS + "&dataFormat=POJO";
> ConnectionFactory connectionFactory = new
> ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
>         context.addRoutes(new RouteBuilder() {
>
>             public void configure() throws Exception {
>                 from("test-jms:queue:test.queue").to(serviceEndpointURI);
>            }
>         });
> CamelTemplate template = new CamelTemplate(context);
> context.start();
>  for (int i = 0; i < 10; i++) {
>             template.sendBody("test-jms:queue:test.queue", "Test Message: "
> + i);
>  }
> Thread.sleep(1000);
> context.stop();
>
> Will the code above work ?
> Ravi
>
>
>
>
>
> willem.jiang wrote:
>  
>> Hi ,
>> I am working on camel-cxf component which will help you to do some
>> router work between 2 Web Services. My big patch just been applied in
>> the trunk, you can take a look at the unit test of camel-cxf component.
>> https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java
>> I will add a Web Service router example some time this week  :)
>>
>> Willem.
>> xtof wrote:
>>    
>>> Hello,
>>>
>>> I'm quite new to Camel, and I'm trying to understand how implementing a
>>> gateway between 2 Web Services. It requires to implement a request-reply
>>> mechanism but I cannot find any example.
>>> Could you help?
>>>
>>> Thank.
>>> Christophe
>>>  
>>>      
>>
>>    
>
>