You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Kazi, Iftekhar" <Ka...@UPMC.EDU> on 2011/01/07 01:23:20 UTC
Routing to a Servlet
Is it possible to post a payload to a existing Servlet on another server using Camel ?
Eg.
<route>
<from uri="direct:start" />
<to uri="xslt:sometransform.xsl"/>
<to uri="http://localhost:8080/myApp/ServletSample" />
Where http://localhost:8080/myApp/ServletSample is an existing Servlet ? Thanks
Re: Routing to a Servlet
Posted by Willem Jiang <wi...@gmail.com>.
I'm afraid you have to do it yourself with a customer processor or bean.
On 1/7/11 8:59 AM, Kazi, Iftekhar wrote:
> Any help on how to do that using Spring xml or pointers. The help would be appreciated. Thanks
>
> -----Original Message-----
> From: Willem Jiang [mailto:willem.jiang@gmail.com]
> Sent: Thursday, January 06, 2011 7:54 PM
> To: users@camel.apache.org
> Subject: Re: Routing to a Servlet
>
> Woo, in this case you need build up form post request before sending it to servlet.
>
> On 1/7/11 8:39 AM, Kazi, Iftekhar wrote:
>> The Servlet Exists and when accessed comes up with an html form with a submit button. However, using the route below lends an error.
>>
>> <route>
>> <from uri="direct:start" />
>> <to uri="xslt:sometransform.xsl"/>
>> <setHeader headerName="CamelHttpMethod">
>> <constant>POST</constant>
>> </setHeader>
>> <to uri="http://tlsomnnstst01:8080/servletsample" />
>>
>>> <to uri="http://localhost:8080/myApp/ServletSample" />
>>
>> -----Original Message-----
>> From: Willem Jiang [mailto:willem.jiang@gmail.com]
>> Sent: Thursday, January 06, 2011 7:32 PM
>> To: users@camel.apache.org
>> Subject: Re: Routing to a Servlet
>>
>> On 1/7/11 8:23 AM, Kazi, Iftekhar wrote:
>>> Is it possible to post a payload to a existing Servlet on another server using Camel ?
>>>
>>> Eg.
>>>
>>> <route>
>>> <from uri="direct:start" />
>>> <to uri="xslt:sometransform.xsl"/>
>> <setHeader headerName="CamelHttpMethod">
>> <constant>POST</constant>
>> </setHeader>
>> <to uri="http://tlsomnnstst01:8080/servletsample" />
>>
>>> <to uri="http://localhost:8080/myApp/ServletSample" />
>>>
>>> Where http://localhost:8080/myApp/ServletSample is an existing
>>> Servlet ? Thanks
>>>
>>>
>>>
>>
>> Absolutely yes.
>> camel-http component can send the request to the existing servlet.
>> Please make sure the servlet can be accessed locally.
>>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
RE: Routing to a Servlet
Posted by "Kazi, Iftekhar" <Ka...@UPMC.EDU>.
Any help on how to do that using Spring xml or pointers. The help would be appreciated. Thanks
-----Original Message-----
From: Willem Jiang [mailto:willem.jiang@gmail.com]
Sent: Thursday, January 06, 2011 7:54 PM
To: users@camel.apache.org
Subject: Re: Routing to a Servlet
Woo, in this case you need build up form post request before sending it to servlet.
On 1/7/11 8:39 AM, Kazi, Iftekhar wrote:
> The Servlet Exists and when accessed comes up with an html form with a submit button. However, using the route below lends an error.
>
> <route>
> <from uri="direct:start" />
> <to uri="xslt:sometransform.xsl"/>
> <setHeader headerName="CamelHttpMethod">
> <constant>POST</constant>
> </setHeader>
> <to uri="http://tlsomnnstst01:8080/servletsample" />
>
>> <to uri="http://localhost:8080/myApp/ServletSample" />
>
> -----Original Message-----
> From: Willem Jiang [mailto:willem.jiang@gmail.com]
> Sent: Thursday, January 06, 2011 7:32 PM
> To: users@camel.apache.org
> Subject: Re: Routing to a Servlet
>
> On 1/7/11 8:23 AM, Kazi, Iftekhar wrote:
>> Is it possible to post a payload to a existing Servlet on another server using Camel ?
>>
>> Eg.
>>
>> <route>
>> <from uri="direct:start" />
>> <to uri="xslt:sometransform.xsl"/>
> <setHeader headerName="CamelHttpMethod">
> <constant>POST</constant>
> </setHeader>
> <to uri="http://tlsomnnstst01:8080/servletsample" />
>
>> <to uri="http://localhost:8080/myApp/ServletSample" />
>>
>> Where http://localhost:8080/myApp/ServletSample is an existing
>> Servlet ? Thanks
>>
>>
>>
>
> Absolutely yes.
> camel-http component can send the request to the existing servlet.
> Please make sure the servlet can be accessed locally.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Re: Routing to a Servlet
Posted by Willem Jiang <wi...@gmail.com>.
Woo, in this case you need build up form post request before sending it
to servlet.
On 1/7/11 8:39 AM, Kazi, Iftekhar wrote:
> The Servlet Exists and when accessed comes up with an html form with a submit button. However, using the route below lends an error.
>
> <route>
> <from uri="direct:start" />
> <to uri="xslt:sometransform.xsl"/>
> <setHeader headerName="CamelHttpMethod">
> <constant>POST</constant>
> </setHeader>
> <to uri="http://tlsomnnstst01:8080/servletsample" />
>
>> <to uri="http://localhost:8080/myApp/ServletSample" />
>
> -----Original Message-----
> From: Willem Jiang [mailto:willem.jiang@gmail.com]
> Sent: Thursday, January 06, 2011 7:32 PM
> To: users@camel.apache.org
> Subject: Re: Routing to a Servlet
>
> On 1/7/11 8:23 AM, Kazi, Iftekhar wrote:
>> Is it possible to post a payload to a existing Servlet on another server using Camel ?
>>
>> Eg.
>>
>> <route>
>> <from uri="direct:start" />
>> <to uri="xslt:sometransform.xsl"/>
> <setHeader headerName="CamelHttpMethod">
> <constant>POST</constant>
> </setHeader>
> <to uri="http://tlsomnnstst01:8080/servletsample" />
>
>> <to uri="http://localhost:8080/myApp/ServletSample" />
>>
>> Where http://localhost:8080/myApp/ServletSample is an existing Servlet ? Thanks
>>
>>
>>
>
> Absolutely yes.
> camel-http component can send the request to the existing servlet.
> Please make sure the servlet can be accessed locally.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
RE: Routing to a Servlet
Posted by "Kazi, Iftekhar" <Ka...@UPMC.EDU>.
The Servlet Exists and when accessed comes up with an html form with a submit button. However, using the route below lends an error.
<route>
<from uri="direct:start" />
<to uri="xslt:sometransform.xsl"/>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<to uri="http://tlsomnnstst01:8080/servletsample" />
> <to uri="http://localhost:8080/myApp/ServletSample" />
-----Original Message-----
From: Willem Jiang [mailto:willem.jiang@gmail.com]
Sent: Thursday, January 06, 2011 7:32 PM
To: users@camel.apache.org
Subject: Re: Routing to a Servlet
On 1/7/11 8:23 AM, Kazi, Iftekhar wrote:
> Is it possible to post a payload to a existing Servlet on another server using Camel ?
>
> Eg.
>
> <route>
> <from uri="direct:start" />
> <to uri="xslt:sometransform.xsl"/>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<to uri="http://tlsomnnstst01:8080/servletsample" />
> <to uri="http://localhost:8080/myApp/ServletSample" />
>
> Where http://localhost:8080/myApp/ServletSample is an existing Servlet ? Thanks
>
>
>
Absolutely yes.
camel-http component can send the request to the existing servlet.
Please make sure the servlet can be accessed locally.
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Re: Routing to a Servlet
Posted by Willem Jiang <wi...@gmail.com>.
On 1/7/11 8:23 AM, Kazi, Iftekhar wrote:
> Is it possible to post a payload to a existing Servlet on another server using Camel ?
>
> Eg.
>
> <route>
> <from uri="direct:start" />
> <to uri="xslt:sometransform.xsl"/>
> <to uri="http://localhost:8080/myApp/ServletSample" />
>
> Where http://localhost:8080/myApp/ServletSample is an existing Servlet ? Thanks
>
>
>
Absolutely yes.
camel-http component can send the request to the existing servlet.
Please make sure the servlet can be accessed locally.
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang