You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by wolfram <wo...@ritsuka.org> on 2012/06/28 18:38:37 UTC

How to expose JAX-RS service via Camel transport?

Hi.

I have REST service with definition like


It's located in CXF configured via spring configuration with camel backend.
I've successfully exposed JAX-WS services in the following way:


So, I want to expose my REST service in similar way. But there is no
"endpoint" definition in http://cxf.apache.org/schemas/jaxrs.xsd

So could anybody give me a hint if is it possible to expose REST via camel
backend? If no is any way exists to expose it from standalone application
(without servlet container)?



--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-expose-JAX-RS-service-via-Camel-transport-tp5710423.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to expose JAX-RS service via Camel transport?

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 28/06/12 18:20, wolfram wrote:
> I've resolved issue
>
> 1) I've missed ?matchOnUriPrefix=true from your blog
> 2) jetty:http://localhost:9998/rest/hw?matchOnUriPrefix=true +
> @Path("/rest/hw") =>  service is accessible at
> http://localhost:9998/rest/hw/rest/hw/get/xxx

Great, my colleague Cristian did the original demo

Sergey

>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/How-to-expose-JAX-RS-service-via-Camel-transport-tp5710423p5710428.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: How to expose JAX-RS service via Camel transport?

Posted by wolfram <wo...@ritsuka.org>.
I've resolved issue

1) I've missed ?matchOnUriPrefix=true from your blog
2) jetty:http://localhost:9998/rest/hw?matchOnUriPrefix=true +
@Path("/rest/hw") => service is accessible at
http://localhost:9998/rest/hw/rest/hw/get/xxx



--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-expose-JAX-RS-service-via-Camel-transport-tp5710423p5710428.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to expose JAX-RS service via Camel transport?

Posted by wolfram <wo...@ritsuka.org>.
Thank you very much, looks like that problem is near to be solved. But I've
stuck on the following problem:

My shiny new endpoint config is 


and camel route is


and service definition is


But I can't reach method sayHi at urls http://localhost:9998/rest/hw/get/xxx
I've also tried http://localhost:9998/rest/hw/rest/hw/get/xxx but without
any success.

So, could you be so kind to give me a hint how to resolve this?

--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-expose-JAX-RS-service-via-Camel-transport-tp5710423p5710426.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to expose JAX-RS service via Camel transport?

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 28/06/12 17:38, wolfram wrote:
> Hi.
>
> I have REST service with definition like
>
>
> It's located in CXF configured via spring configuration with camel backend.
> I've successfully exposed JAX-WS services in the following way:
>
>
> So, I want to expose my REST service in similar way. But there is no
> "endpoint" definition in http://cxf.apache.org/schemas/jaxrs.xsd
>
> So could anybody give me a hint if is it possible to expose REST via camel
> backend? If no is any way exists to expose it from standalone application
> (without servlet container)?
>


The service bean should be shared between jaxws and jaxrs endpoints 
(jaxrs:server in the latter case), example:
http://cxf.apache.org/docs/jax-rs-and-jax-ws.html

See also

http://sberyozkin.blogspot.ie/2011/05/how-to-use-camel-transport-with-cxf-jax.html

HTH, Sergey

>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/How-to-expose-JAX-RS-service-via-Camel-transport-tp5710423.html
> Sent from the cxf-user mailing list archive at Nabble.com.