Hi

On Mon, May 17, 2010 at 3:23 PM, yoMrJ <[email protected]> wrote:

>
> Sorry Sergey, something went wrong with my mail :) I suppose that were the
> <!-- tags - they broke partially my stupid mail account :D o0.
>
> no problems


> So here i try anew:
>
> this is the content of my sd.xml:
>
>  <service-decoration>
>       <match interface="test.MyService">
>         <add-property name="service.exported.interfaces"
> value="test.MyService" />
>          <add-property name="service.exported.configs"
> value="org.apache.cxf.rs" />
>         <add-property name="service.exported.intents" value="HTTP" />
>          <add-property name="org.apache.cxf.rs.address"
> value="/myservice"/>
>         <add-property name="org.apache.cxf.rs.httpservice.context"
> value="/rest/ws/myservice"/>
>          <add-property name="org.apache.cxf.rs.databinding" value="aegis"/>
>      </match>
>   </service-decoration>
>
>
you need to use either  "org.apache.cxf.rs.address" which is an absolute
address or "org.apache.cxf.rs.
httpservice.context".


> my remote-services.xml looks like following:
>
>   <service-description>
>    <provide interface="test.MyService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <property
> name="osgi.remote.configuration.pojo.address">http://
> ${DOSGI_SERVER}:23990/dosgi/ws/myservice</property>
>  </service-description>
>
>
> MyService works flawlesly as a SOAP Web Service (by changing the
> configuration on sd.xml and remote-services.xml). Could you please tell me
> what are the actual steps to expose a OSGI Service as a RESTful Web
> Service.
> I suppose that I have to:
> 1) edit sd.xml
> 2) edit remote-services.xml
>

remote-services.xml is optional (you do not need it if you use the discovery
service) but here is an example

http://svn.apache.org/repos/asf/cxf/dosgi/trunk/samples/greeter_rest/client/src/main/resources/OSGI-INF/remote-service/remote-services.xml

3) What else? Do I need some annotations or could I go without them?
>

see
http://cxf.apache.org/docs/jax-rs.html#JAX-RS-IntegrationwithDistributedOSGi



> 4) Do I need some extra libraries and if so where should I put them?
>
> For JSON you need to install Jettison 1.2 or indeed any other JSON aware
bundle and list it as a provider


> 5) can MyService be exposed as a SOAP and RESTful simultaneously (in the
> same time)?
>

Do you mean such that a single bean *instance* can handle both SOAP and REST
requests ? In DOSGI this can not be done by configuring the properties only.
At the moment this can only be done by explicitly registering the same bean
instance as both SOAP and RESTful service (doing two OSGI service
registration calls) from a custom bundle activator

cheers, Sergey


> Thanks for your help!
>
> Cheers,
> George
>
>
>
>
>
>
>
>
>
>
>
>
> Sergey Beryozkin-5 wrote:
> >
> >
> > Hi
> >
> > How does your sd.xml look like (just would like to see the properties).
> > Also
> > make sure that JAX RS api packages are being imported, though there's an
> > option there to avoid importing them...
> >
> > cheers, Sergey
> >
> > On Mon, May 17, 2010 at 1:31 PM, Georgi Dimitrov <[email protected]> wrote:
> >
> >>
> >> Hi People,
> >>
> >> I was trying to expose one of my OSGI Services as a Restful Web Service
> >> (exposing that same service as a SOAP Web Service works). For that
> >> purpose I
> >> am writing the appropriate informations (e.g. properties) in the sd.xml
> >> and
> >> remote-services.xml files.
> >>
> >> But when I try to reach the RESTful web Service through Web Browser I
> >> only
> >> get the following response:
> >>
> >> " No services have been found. "
> >>
> >> Could you help me with this, since I have no Idea what I've done wrong.
> >>
> >> Regards,
> >> George
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/CXF-Distributed-OSGI-and-RESTful-tp28582737p28584051.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Reply via email to