2009/4/20 jsbournival <[email protected]>:
>
> AFAIK, configuring a restful service requires to specify this snippet of XML
> code in the spring meta-inf file:
>
> <jaxrs:server address="http://localhost:9080/";>
> <jaxrs:serviceBeans>
> <ref bean="restfulService"/>
> </jaxrs:serviceBeans>
> </jaxrs:server>
>
> It's working fine.
>
> What is bugging me is the fact that I need to pick a server address, with a
> port. What if 3 people are working on 3 different bundle containing a JAX-RS
> service.

If you're using the cxf-transport-osgi servlet style transport, then
you do not need to specify the full listen URI (i.e.
"http://localhost:9080/"; in your case).

Instead you can just specify the context path in <jaxrs:server>
address attribute, and this is appended to a root URI of
http://localhost:8080/cxf, or whatever port you've configured.

So for example, your three bundles could be configured like so:

<jaxrs:server address="/first" ...>

<jaxrs:server address="/second" ...>

<jaxrs:server address="/third" ...>

BTW I'm working thru' some minor issues in using CXF JAX-RS with the
cxf-transport-osgi stuff, but it should be working soon.

Cheers,
Eoghan

Reply via email to