You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Marc Durand <ma...@gmail.com> on 2016/08/15 15:21:42 UTC

RESTful web service in Karaf using CXF and blueprint

Hello,
I was following Christian's tutorial here:
http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi

And I also found come blog posts from JB that show how to deploy RESTful
services using blueprint.  

What I couldn't find was an example on how to deploy a RESTful service where
the resource class is an OSGi service (to take advantage of SCR references
to other services in the resource class).  I was able to do it by using a
<reference> element instead of a <bean> element in the blueprint file.  Is
this approach correct or will it lead to other problems down the road?

Thanks!
Marc




--
View this message in context: http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: RESTful web service in Karaf using CXF and blueprint

Posted by Benson Margulies <be...@basistech.com>.
Christian, you might recall that I got into problems with
configuration issues, and you plan to address the issues I ran into in
2.0. I can dig that mail up again if you don't still have it. Thus
'not ready yet.'

On Mon, Aug 15, 2016 at 1:30 PM, Christian Schneider
<ch...@die-schneider.net> wrote:
> Hi Benson,
>
> would be great to get some feedback about your experiences using dOSGi. As
> we are approaching the 2.0 version now is the best time to get important
> features in.
>
> Christian
>
> 2016-08-15 19:24 GMT+02:00 Benson Margulies <be...@basistech.com>:
>>
>> Correct. I tried the dOSGi stuff, and it wasn't really ready to do
>> what I needed to do.
>>
>> On Mon, Aug 15, 2016 at 1:17 PM, David Jencks <da...@gmail.com>
>> wrote:
>> > Just to see if I understand what you are doing, this approach does not
>> > involve the osgi service registry in any way for the REST service
>> > implementation object?  You are directly registering the component instance
>> > with CXF, and there is no need for it to expose any service interfaces at
>> > all?
>> >
>> > thanks
>> > david jencks
>> >
>> >> On Aug 15, 2016, at 10:10 AM, Benson Margulies <be...@basistech.com>
>> >> wrote:
>> >>
>> >> I do this by making DS @Activate methods call the CXF API to publish
>> >> REST services.
>> >>
>> >>
>> >> On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sl...@composent.com>
>> >> wrote:
>> >>> Hi Marc,
>> >>>
>> >>> The OSGi Remote Services specification (and the associated Remote
>> >>> Service
>> >>> Admin sepc) defines a standardized way to export OSGi services for
>> >>> remote
>> >>> access.   The specification is defined in a way that allows the use of
>> >>> arbitrary distribution providers that are responsible for making the
>> >>> OSGi
>> >>> service accessible from outside of the OSGi process.
>> >>>
>> >>> ECF [1] has an implementation of these specs that supports many
>> >>> distribution
>> >>> providers [2], including two that I'm working on now that supports any
>> >>> Jax-RS implementation (i.e. both CXF and Jersey).   These two
>> >>> distribution
>> >>> providers are here [3] and I'm finalizing them for an initial release.
>> >>> Note that for these providers, in addition to specifying jax-rs
>> >>> resources
>> >>> via OSGi services, the jax-rs configuration (e.g.
>> >>> MessageBodyReader/Writers,
>> >>> Features, etc) can also be specified via OSGi services.
>> >>>
>> >>> Scott
>> >>>
>> >>> [1] https://wiki.eclipse.org/ECF
>> >>> [2] https://wiki.eclipse.org/Distribution_Providers
>> >>> [3] https://github.com/ECF/JaxRSProviders
>> >>>
>> >>> On 8/15/2016 8:21 AM, Marc Durand wrote:
>> >>>>
>> >>>> Hello,
>> >>>> I was following Christian's tutorial here:
>> >>>>
>> >>>>
>> >>>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
>> >>>>
>> >>>> And I also found come blog posts from JB that show how to deploy
>> >>>> RESTful
>> >>>> services using blueprint.
>> >>>>
>> >>>> What I couldn't find was an example on how to deploy a RESTful
>> >>>> service
>> >>>> where
>> >>>> the resource class is an OSGi service (to take advantage of SCR
>> >>>> references
>> >>>> to other services in the resource class).  I was able to do it by
>> >>>> using a
>> >>>> <reference> element instead of a <bean> element in the blueprint
>> >>>> file.  Is
>> >>>> this approach correct or will it lead to other problems down the
>> >>>> road?
>> >>>>
>> >>>> Thanks!
>> >>>> Marc
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> View this message in context:
>> >>>>
>> >>>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
>> >>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>> >>>
>> >>>
>> >>>
>> >
>
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com

Re: RESTful web service in Karaf using CXF and blueprint

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Benson,

would be great to get some feedback about your experiences using dOSGi. As
we are approaching the 2.0 version now is the best time to get important
features in.

Christian

2016-08-15 19:24 GMT+02:00 Benson Margulies <be...@basistech.com>:

> Correct. I tried the dOSGi stuff, and it wasn't really ready to do
> what I needed to do.
>
> On Mon, Aug 15, 2016 at 1:17 PM, David Jencks <da...@gmail.com>
> wrote:
> > Just to see if I understand what you are doing, this approach does not
> involve the osgi service registry in any way for the REST service
> implementation object?  You are directly registering the component instance
> with CXF, and there is no need for it to expose any service interfaces at
> all?
> >
> > thanks
> > david jencks
> >
> >> On Aug 15, 2016, at 10:10 AM, Benson Margulies <be...@basistech.com>
> wrote:
> >>
> >> I do this by making DS @Activate methods call the CXF API to publish
> >> REST services.
> >>
> >>
> >> On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sl...@composent.com>
> wrote:
> >>> Hi Marc,
> >>>
> >>> The OSGi Remote Services specification (and the associated Remote
> Service
> >>> Admin sepc) defines a standardized way to export OSGi services for
> remote
> >>> access.   The specification is defined in a way that allows the use of
> >>> arbitrary distribution providers that are responsible for making the
> OSGi
> >>> service accessible from outside of the OSGi process.
> >>>
> >>> ECF [1] has an implementation of these specs that supports many
> distribution
> >>> providers [2], including two that I'm working on now that supports any
> >>> Jax-RS implementation (i.e. both CXF and Jersey).   These two
> distribution
> >>> providers are here [3] and I'm finalizing them for an initial release.
> >>> Note that for these providers, in addition to specifying jax-rs
> resources
> >>> via OSGi services, the jax-rs configuration (e.g.
> MessageBodyReader/Writers,
> >>> Features, etc) can also be specified via OSGi services.
> >>>
> >>> Scott
> >>>
> >>> [1] https://wiki.eclipse.org/ECF
> >>> [2] https://wiki.eclipse.org/Distribution_Providers
> >>> [3] https://github.com/ECF/JaxRSProviders
> >>>
> >>> On 8/15/2016 8:21 AM, Marc Durand wrote:
> >>>>
> >>>> Hello,
> >>>> I was following Christian's tutorial here:
> >>>>
> >>>> http://liquid-reality.de/display/liquid/2011/12/22/
> Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
> >>>>
> >>>> And I also found come blog posts from JB that show how to deploy
> RESTful
> >>>> services using blueprint.
> >>>>
> >>>> What I couldn't find was an example on how to deploy a RESTful service
> >>>> where
> >>>> the resource class is an OSGi service (to take advantage of SCR
> references
> >>>> to other services in the resource class).  I was able to do it by
> using a
> >>>> <reference> element instead of a <bean> element in the blueprint
> file.  Is
> >>>> this approach correct or will it lead to other problems down the road?
> >>>>
> >>>> Thanks!
> >>>> Marc
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-
> Karaf-using-CXF-and-blueprint-tp4047529.html
> >>>> Sent from the Karaf - User mailing list archive at Nabble.com.
> >>>
> >>>
> >>>
> >
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: RESTful web service in Karaf using CXF and blueprint

Posted by Benson Margulies <be...@basistech.com>.
Correct. I tried the dOSGi stuff, and it wasn't really ready to do
what I needed to do.

On Mon, Aug 15, 2016 at 1:17 PM, David Jencks <da...@gmail.com> wrote:
> Just to see if I understand what you are doing, this approach does not involve the osgi service registry in any way for the REST service implementation object?  You are directly registering the component instance with CXF, and there is no need for it to expose any service interfaces at all?
>
> thanks
> david jencks
>
>> On Aug 15, 2016, at 10:10 AM, Benson Margulies <be...@basistech.com> wrote:
>>
>> I do this by making DS @Activate methods call the CXF API to publish
>> REST services.
>>
>>
>> On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sl...@composent.com> wrote:
>>> Hi Marc,
>>>
>>> The OSGi Remote Services specification (and the associated Remote Service
>>> Admin sepc) defines a standardized way to export OSGi services for remote
>>> access.   The specification is defined in a way that allows the use of
>>> arbitrary distribution providers that are responsible for making the OSGi
>>> service accessible from outside of the OSGi process.
>>>
>>> ECF [1] has an implementation of these specs that supports many distribution
>>> providers [2], including two that I'm working on now that supports any
>>> Jax-RS implementation (i.e. both CXF and Jersey).   These two distribution
>>> providers are here [3] and I'm finalizing them for an initial release.
>>> Note that for these providers, in addition to specifying jax-rs resources
>>> via OSGi services, the jax-rs configuration (e.g. MessageBodyReader/Writers,
>>> Features, etc) can also be specified via OSGi services.
>>>
>>> Scott
>>>
>>> [1] https://wiki.eclipse.org/ECF
>>> [2] https://wiki.eclipse.org/Distribution_Providers
>>> [3] https://github.com/ECF/JaxRSProviders
>>>
>>> On 8/15/2016 8:21 AM, Marc Durand wrote:
>>>>
>>>> Hello,
>>>> I was following Christian's tutorial here:
>>>>
>>>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
>>>>
>>>> And I also found come blog posts from JB that show how to deploy RESTful
>>>> services using blueprint.
>>>>
>>>> What I couldn't find was an example on how to deploy a RESTful service
>>>> where
>>>> the resource class is an OSGi service (to take advantage of SCR references
>>>> to other services in the resource class).  I was able to do it by using a
>>>> <reference> element instead of a <bean> element in the blueprint file.  Is
>>>> this approach correct or will it lead to other problems down the road?
>>>>
>>>> Thanks!
>>>> Marc
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
>>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>
>>>
>>>
>

Re: RESTful web service in Karaf using CXF and blueprint

Posted by David Jencks <da...@gmail.com>.
Just to see if I understand what you are doing, this approach does not involve the osgi service registry in any way for the REST service implementation object?  You are directly registering the component instance with CXF, and there is no need for it to expose any service interfaces at all?

thanks
david jencks

> On Aug 15, 2016, at 10:10 AM, Benson Margulies <be...@basistech.com> wrote:
> 
> I do this by making DS @Activate methods call the CXF API to publish
> REST services.
> 
> 
> On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sl...@composent.com> wrote:
>> Hi Marc,
>> 
>> The OSGi Remote Services specification (and the associated Remote Service
>> Admin sepc) defines a standardized way to export OSGi services for remote
>> access.   The specification is defined in a way that allows the use of
>> arbitrary distribution providers that are responsible for making the OSGi
>> service accessible from outside of the OSGi process.
>> 
>> ECF [1] has an implementation of these specs that supports many distribution
>> providers [2], including two that I'm working on now that supports any
>> Jax-RS implementation (i.e. both CXF and Jersey).   These two distribution
>> providers are here [3] and I'm finalizing them for an initial release.
>> Note that for these providers, in addition to specifying jax-rs resources
>> via OSGi services, the jax-rs configuration (e.g. MessageBodyReader/Writers,
>> Features, etc) can also be specified via OSGi services.
>> 
>> Scott
>> 
>> [1] https://wiki.eclipse.org/ECF
>> [2] https://wiki.eclipse.org/Distribution_Providers
>> [3] https://github.com/ECF/JaxRSProviders
>> 
>> On 8/15/2016 8:21 AM, Marc Durand wrote:
>>> 
>>> Hello,
>>> I was following Christian's tutorial here:
>>> 
>>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
>>> 
>>> And I also found come blog posts from JB that show how to deploy RESTful
>>> services using blueprint.
>>> 
>>> What I couldn't find was an example on how to deploy a RESTful service
>>> where
>>> the resource class is an OSGi service (to take advantage of SCR references
>>> to other services in the resource class).  I was able to do it by using a
>>> <reference> element instead of a <bean> element in the blueprint file.  Is
>>> this approach correct or will it lead to other problems down the road?
>>> 
>>> Thanks!
>>> Marc
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>> 
>> 
>> 


Re: RESTful web service in Karaf using CXF and blueprint

Posted by Benson Margulies <be...@basistech.com>.
I do this by making DS @Activate methods call the CXF API to publish
REST services.


On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sl...@composent.com> wrote:
> Hi Marc,
>
> The OSGi Remote Services specification (and the associated Remote Service
> Admin sepc) defines a standardized way to export OSGi services for remote
> access.   The specification is defined in a way that allows the use of
> arbitrary distribution providers that are responsible for making the OSGi
> service accessible from outside of the OSGi process.
>
> ECF [1] has an implementation of these specs that supports many distribution
> providers [2], including two that I'm working on now that supports any
> Jax-RS implementation (i.e. both CXF and Jersey).   These two distribution
> providers are here [3] and I'm finalizing them for an initial release.
> Note that for these providers, in addition to specifying jax-rs resources
> via OSGi services, the jax-rs configuration (e.g. MessageBodyReader/Writers,
> Features, etc) can also be specified via OSGi services.
>
> Scott
>
> [1] https://wiki.eclipse.org/ECF
> [2] https://wiki.eclipse.org/Distribution_Providers
> [3] https://github.com/ECF/JaxRSProviders
>
> On 8/15/2016 8:21 AM, Marc Durand wrote:
>>
>> Hello,
>> I was following Christian's tutorial here:
>>
>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
>>
>> And I also found come blog posts from JB that show how to deploy RESTful
>> services using blueprint.
>>
>> What I couldn't find was an example on how to deploy a RESTful service
>> where
>> the resource class is an OSGi service (to take advantage of SCR references
>> to other services in the resource class).  I was able to do it by using a
>> <reference> element instead of a <bean> element in the blueprint file.  Is
>> this approach correct or will it lead to other problems down the road?
>>
>> Thanks!
>> Marc
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>

Re: RESTful web service in Karaf using CXF and blueprint

Posted by Scott Lewis <sl...@composent.com>.
Hi Marc,

The OSGi Remote Services specification (and the associated Remote 
Service Admin sepc) defines a standardized way to export OSGi services 
for remote access.   The specification is defined in a way that allows 
the use of arbitrary distribution providers that are responsible for 
making the OSGi service accessible from outside of the OSGi process.

ECF [1] has an implementation of these specs that supports many 
distribution providers [2], including two that I'm working on now that 
supports any Jax-RS implementation (i.e. both CXF and Jersey).   These 
two distribution providers are here [3] and I'm finalizing them for an 
initial release.   Note that for these providers, in addition to 
specifying jax-rs resources via OSGi services, the jax-rs configuration 
(e.g. MessageBodyReader/Writers, Features, etc) can also be specified 
via OSGi services.

Scott

[1] https://wiki.eclipse.org/ECF
[2] https://wiki.eclipse.org/Distribution_Providers
[3] https://github.com/ECF/JaxRSProviders

On 8/15/2016 8:21 AM, Marc Durand wrote:
> Hello,
> I was following Christian's tutorial here:
> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
>
> And I also found come blog posts from JB that show how to deploy RESTful
> services using blueprint.
>
> What I couldn't find was an example on how to deploy a RESTful service where
> the resource class is an OSGi service (to take advantage of SCR references
> to other services in the resource class).  I was able to do it by using a
> <reference> element instead of a <bean> element in the blueprint file.  Is
> this approach correct or will it lead to other problems down the road?
>
> Thanks!
> Marc
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
> Sent from the Karaf - User mailing list archive at Nabble.com.



Re: RESTful web service in Karaf using CXF and blueprint

Posted by Marc Durand <ma...@gmail.com>.
Thanks everyone for your help.  I have decided to stay with blueprint and
pass references to OSGi services to the resource classes via the
constructor.  Something like this:

IN BLUEPRINT:
​​<reference id="dbFactory"
interface="com.mycompany.grid.database.DatabaseHelperFactory"
/>

<bean id="playRestTwo" class="com.mycompany.grid.play.two.impl.PlayRestTwo">
   <argument ref="dbFactory" />
   <argument ref="blueprintBundleContext" />
</bean>

<jaxrs:server id="server" address="/rest2/playTwo">
   <jaxrs:serviceBeans>
      <ref component-id="playRestTwo" />
   </jaxrs:serviceBeans>

IN RESOURCE CLASS:

@Produces(MediaType.APPLICATION_JSON)
@Path("/playTwo")
public class PlayRestTwo {

private DatabaseHelperFactory dbFactory;
private String transactionProc;

public PlayRestTwo(BundleContext bundleContext, DatabaseHelperFactory
dbFactory) {
   this.bundleContext = bundleContext;
   this.dbFactory = dbFactory;
}

​Marc

​

On Mon, Aug 15, 2016 at 2:45 PM, Tim Ward <ti...@paremus.com> wrote:

> If the services that you're looking to provide use JAX-RS the there is a
> specification proposal for OSGi R7 that you should look at. Prototyping
> work is starting in Apache Aries now.
>
> Tim
>
> Sent from my iPhone
>
> On 15 Aug 2016, at 18:56, Scott Lewis <sl...@composent.com> wrote:
>
> On 8/15/2016 10:28 AM, Christian Schneider wrote:
>
> <stuff deleted>
>
> ECF also supports CXF now but I am not sure at what level of CXF features.
>
>
> This provider [1], will support all of the jax-rs
> Configurable/Configuration capabilities that CXF supports.   It will also
> be possible to extend [1] to create a custom provider, which are of course
> free use any of CXF's APIs.   Same with Jersey.
>
> Scott
>
> [1] https://github.com/ECF/JaxRSProviders/tree/master/
> bundles/org.eclipse.ecf.provider.cxf.server
>
>
> Christian
>
> 2016-08-15 17:21 GMT+02:00 Marc Durand <ma...@gmail.com>:
>
>> Hello,
>> I was following Christian's tutorial here:
>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+
>> Tutorial+Part+4+-+CXF+Services+in+OSGi
>>
>> And I also found come blog posts from JB that show how to deploy RESTful
>> services using blueprint.
>>
>> What I couldn't find was an example on how to deploy a RESTful service
>> where
>> the resource class is an OSGi service (to take advantage of SCR references
>> to other services in the resource class).  I was able to do it by using a
>> <reference> element instead of a <bean> element in the blueprint file.  Is
>> this approach correct or will it lead to other problems down the road?
>>
>> Thanks!
>> Marc
>>
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.
>> com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
>> Sent from the Karaf - User mailing list archive at Nabble.com
>> <http://nabble.com>.
>>
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
> Open Source Architect
> http://www.talend.com
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>
>
>

Re: RESTful web service in Karaf using CXF and blueprint

Posted by Tim Ward <ti...@paremus.com>.
If the services that you're looking to provide use JAX-RS the there is a specification proposal for OSGi R7 that you should look at. Prototyping work is starting in Apache Aries now.

Tim

Sent from my iPhone

> On 15 Aug 2016, at 18:56, Scott Lewis <sl...@composent.com> wrote:
> 
>> On 8/15/2016 10:28 AM, Christian Schneider wrote:
>> <stuff deleted>
>> 
>> ECF also supports CXF now but I am not sure at what level of CXF features.
> 
> This provider [1], will support all of the jax-rs Configurable/Configuration capabilities that CXF supports.   It will also be possible to extend [1] to create a custom provider, which are of course free use any of CXF's APIs.   Same with Jersey.
> 
> Scott
> 
> [1] https://github.com/ECF/JaxRSProviders/tree/master/bundles/org.eclipse.ecf.provider.cxf.server
> 
>> 
>> Christian
>> 
>> 2016-08-15 17:21 GMT+02:00 Marc Durand <ma...@gmail.com>:
>>> Hello,
>>> I was following Christian's tutorial here:
>>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
>>> 
>>> And I also found come blog posts from JB that show how to deploy RESTful
>>> services using blueprint.
>>> 
>>> What I couldn't find was an example on how to deploy a RESTful service where
>>> the resource class is an OSGi service (to take advantage of SCR references
>>> to other services in the resource class).  I was able to do it by using a
>>> <reference> element instead of a <bean> element in the blueprint file.  Is
>>> this approach correct or will it lead to other problems down the road?
>>> 
>>> Thanks!
>>> Marc
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context: http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>> 
>> 
>> 
>> -- 
>> -- 
>> Christian Schneider
>> http://www.liquid-reality.de
>> 
>> Open Source Architect
>> http://www.talend.com
> 

Re: RESTful web service in Karaf using CXF and blueprint

Posted by Scott Lewis <sl...@composent.com>.
On 8/15/2016 10:28 AM, Christian Schneider wrote:
> <stuff deleted>
>
> ECF also supports CXF now but I am not sure at what level of CXF features.

This provider [1], will support all of the jax-rs 
Configurable/Configuration capabilities that CXF supports.   It will 
also be possible to extend [1] to create a custom provider, which are of 
course free use any of CXF's APIs.   Same with Jersey.

Scott

[1] 
https://github.com/ECF/JaxRSProviders/tree/master/bundles/org.eclipse.ecf.provider.cxf.server

>
> Christian
>
> 2016-08-15 17:21 GMT+02:00 Marc Durand <marc.durand@gmail.com 
> <ma...@gmail.com>>:
>
>     Hello,
>     I was following Christian's tutorial here:
>     http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
>     <http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi>
>
>     And I also found come blog posts from JB that show how to deploy
>     RESTful
>     services using blueprint.
>
>     What I couldn't find was an example on how to deploy a RESTful
>     service where
>     the resource class is an OSGi service (to take advantage of SCR
>     references
>     to other services in the resource class).  I was able to do it by
>     using a
>     <reference> element instead of a <bean> element in the blueprint
>     file.  Is
>     this approach correct or will it lead to other problems down the road?
>
>     Thanks!
>     Marc
>
>
>
>
>     --
>     View this message in context:
>     http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
>     <http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html>
>     Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>
>
> -- 
> -- 
> Christian Schneider
> http://www.liquid-reality.de 
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
> Open Source Architect
> http://www.talend.com 
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>



Re: RESTful web service in Karaf using CXF and blueprint

Posted by Christian Schneider <ch...@die-schneider.net>.
 The tutorial uses blueprint to publish the service and uses the CXF
namespace for blueprint. This is currently the most flexible approach as it
supports all features of CXF. It is limited to blueprint though.

If you want to use DS to annotate your service and do injections then like
Scott described Remote Service Admin is the better choice as DS is not
directly supported by CXF. If you want to expose SOAP and REST services
then CXF DOSGi provides a quite complete support for the CXF features. The
upcoming version 2.0 of CXF DOSGi will be slimmer in footprint and support
even more CXF features so it will be almost en par with CXF blueprint. It
allows to define almost all CXF settings using intents (Databinding,
binding, SSL, security, Rest providers, Logging, CXF features, http
conduits).

ECF also supports CXF now but I am not sure at what level of CXF features.

Christian

2016-08-15 17:21 GMT+02:00 Marc Durand <ma...@gmail.com>:

> Hello,
> I was following Christian's tutorial here:
> http://liquid-reality.de/display/liquid/2011/12/22/
> Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
>
> And I also found come blog posts from JB that show how to deploy RESTful
> services using blueprint.
>
> What I couldn't find was an example on how to deploy a RESTful service
> where
> the resource class is an OSGi service (to take advantage of SCR references
> to other services in the resource class).  I was able to do it by using a
> <reference> element instead of a <bean> element in the blueprint file.  Is
> this approach correct or will it lead to other problems down the road?
>
> Thanks!
> Marc
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>