You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by elMateo <so...@gmail.com> on 2012/10/11 10:57:29 UTC

REST client in ApacheFelix with CXF

Hello all, and sorry if it isn't the correct list to make this question.

I need to develop a REST client into Felix and I'm not sure that I can make
with CXF.

I need to call some POST resources with different parameters. These
parameters are not primitive objects. I know that I can send primitive
objects without problems, but when I try to send other objects (no
primitives) I don't know how do it. I try to develop with RestEasy, but my
OSGi container send me an error like: don't find RestEasy library, when I
put into the container :(

Where can I found examples about this? (REST+OSGi)

Thanks in advance and sorry for the inconvenience.

Best regards, Jesus!!

Re: REST client in ApacheFelix with CXF

Posted by elMateo <so...@gmail.com>.
Thanks Sergey!!

I'm going to research it. Thanks!

On Mon, Oct 15, 2012 at 11:08 AM, Sergey Beryozkin <sb...@gmail.com>wrote:

> On 15/10/12 09:04, elMateo wrote:
>
>> Yes, I try to run and all is ok with this.
>>
>> But the difference with my application is that I don't have a interface, I
>> only have multiple urls with resources, and I need to send some POST and
>> GET messages with two parameters to these resources
>>
>
> Indeed, DOSGi assumes you do depend on the interface.
> Note, you can still use the interface - it's easy to create I guess or it
> can be generated from WADL for you - but if you'd like to have an
> HTTP-centric client code - then please experiment with the alternative
> approach I mentioned in the reply to your original question
>
> Cheers, Sergey
>
>
>> So, what I need for this?
>>
>> Cheers, Jesus
>>
>>
>>
>> On Thu, Oct 11, 2012 at 4:59 PM, Sergey Beryozkin<sberyozkin@gmail.com**
>> >wrote:
>>
>>  On 11/10/12 15:28, elMateo wrote:
>>>
>>>  Hello everybody
>>>>
>>>> I review this example and I try to use. Now, I'm
>>>> using cxf-dosgi-ri-singlebundle-****distribution to develop a REST
>>>> client
>>>>
>>>> into
>>>> my Apache Felix container. But I have some errors and I can't execute my
>>>> bundle :(
>>>>
>>>> Do I need more bundles, a part of cxf-dosgi-ri-singlebundle-**
>>>>
>>>> distribution,
>>>> to develop a REST client into Felix?? Only with this bundle, Felix show
>>>> me
>>>> an error because it don't find javax.ws.rs.core
>>>>
>>>>
>>> Can you try to run a greeter_rest demo available in the distribution ?
>>>
>>> Cheers, Sergey
>>>
>>>
>>>
>>>  Thanks in advance!!
>>>>
>>>>
>>>>
>>>> On Thu, Oct 11, 2012 at 12:04 PM, elMateo<so...@gmail.com>
>>>> wrote:
>>>>
>>>>   Thanks a lot Sergey!!
>>>>
>>>>>
>>>>> I'm going to review it.
>>>>>
>>>>>
>>>>> On Thu, Oct 11, 2012 at 11:58 AM, Sergey Beryozkin<
>>>>> sberyozkin@gmail.com***
>>>>> *>wrote:
>>>>>
>>>>>   Hi
>>>>>
>>>>>>
>>>>>> On 11/10/12 09:57, elMateo wrote:
>>>>>>
>>>>>>   Hello all, and sorry if it isn't the correct list to make this
>>>>>>
>>>>>>> question.
>>>>>>>
>>>>>>> I need to develop a REST client into Felix and I'm not sure that I
>>>>>>> can
>>>>>>> make
>>>>>>> with CXF.
>>>>>>>
>>>>>>> I need to call some POST resources with different parameters. These
>>>>>>> parameters are not primitive objects. I know that I can send
>>>>>>> primitive
>>>>>>> objects without problems, but when I try to send other objects (no
>>>>>>> primitives) I don't know how do it. I try to develop with RestEasy,
>>>>>>> but
>>>>>>> my
>>>>>>> OSGi container send me an error like: don't find RestEasy library,
>>>>>>> when I
>>>>>>> put into the container :(
>>>>>>>
>>>>>>> Where can I found examples about this? (REST+OSGi)
>>>>>>>
>>>>>>> Thanks in advance and sorry for the inconvenience.
>>>>>>>
>>>>>>>   np. You may have a look at a DOSGi CXF subproject or download a
>>>>>>>
>>>>>> Karaf-based distribution with CXF preinstalled (ex, Talend ESB) and
>>>>>> work
>>>>>> with CXF JAX-RS client support, here is one link:
>>>>>>
>>>>>> https://github.com/Talend/******tesb-rt-se/blob/master/**<https://github.com/Talend/****tesb-rt-se/blob/master/**>
>>>>>> <http**s://github.com/Talend/**tesb-**rt-se/blob/master/**<https://github.com/Talend/**tesb-rt-se/blob/master/**>
>>>>>> >
>>>>>> examples/cxf/jaxrs-advanced/******service/src/main/resources/****
>>>>>> META-INF/spring/beans.xml<**http**s://github.com/Talend/**tesb-rt-**<http://github.com/Talend/tesb-rt-**>
>>>>>> se/blob/master/examples/cxf/****jaxrs-advanced/service/src/**
>>>>>> main/resources/META-INF/****spring/beans.xml<https://**
>>>>>> github.com/Talend/tesb-rt-se/**blob/master/examples/cxf/**
>>>>>> jaxrs-advanced/service/src/**main/resources/META-INF/**
>>>>>> spring/beans.xml<https://github.com/Talend/tesb-rt-se/blob/master/examples/cxf/jaxrs-advanced/service/src/main/resources/META-INF/spring/beans.xml>
>>>>>> >
>>>>>>
>>>>>>
>>>>>>>
>>>>>>
>>>>>> (shows Spring configured client loaded in Karaf, same can be done with
>>>>>> Blueprint)
>>>>>>
>>>>>> HTH, Sergey
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>   Best regards, Jesus!!
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>>> Sergey Beryozkin
>>>>>>
>>>>>> Talend Community Coders
>>>>>> http://coders.talend.com/
>>>>>>
>>>>>> Blog: http://sberyozkin.blogspot.com
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
>

Re: REST client in ApacheFelix with CXF

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 15/10/12 09:04, elMateo wrote:
> Yes, I try to run and all is ok with this.
>
> But the difference with my application is that I don't have a interface, I
> only have multiple urls with resources, and I need to send some POST and
> GET messages with two parameters to these resources

Indeed, DOSGi assumes you do depend on the interface.
Note, you can still use the interface - it's easy to create I guess or 
it can be generated from WADL for you - but if you'd like to have an 
HTTP-centric client code - then please experiment with the alternative 
approach I mentioned in the reply to your original question

Cheers, Sergey

>
> So, what I need for this?
>
> Cheers, Jesus
>
>
>
> On Thu, Oct 11, 2012 at 4:59 PM, Sergey Beryozkin<sb...@gmail.com>wrote:
>
>> On 11/10/12 15:28, elMateo wrote:
>>
>>> Hello everybody
>>>
>>> I review this example and I try to use. Now, I'm
>>> using cxf-dosgi-ri-singlebundle-**distribution to develop a REST client
>>> into
>>> my Apache Felix container. But I have some errors and I can't execute my
>>> bundle :(
>>>
>>> Do I need more bundles, a part of cxf-dosgi-ri-singlebundle-**
>>> distribution,
>>> to develop a REST client into Felix?? Only with this bundle, Felix show me
>>> an error because it don't find javax.ws.rs.core
>>>
>>
>> Can you try to run a greeter_rest demo available in the distribution ?
>>
>> Cheers, Sergey
>>
>>
>>
>>> Thanks in advance!!
>>>
>>>
>>>
>>> On Thu, Oct 11, 2012 at 12:04 PM, elMateo<so...@gmail.com>   wrote:
>>>
>>>   Thanks a lot Sergey!!
>>>>
>>>> I'm going to review it.
>>>>
>>>>
>>>> On Thu, Oct 11, 2012 at 11:58 AM, Sergey Beryozkin<sberyozkin@gmail.com*
>>>> *>wrote:
>>>>
>>>>   Hi
>>>>>
>>>>> On 11/10/12 09:57, elMateo wrote:
>>>>>
>>>>>   Hello all, and sorry if it isn't the correct list to make this
>>>>>> question.
>>>>>>
>>>>>> I need to develop a REST client into Felix and I'm not sure that I can
>>>>>> make
>>>>>> with CXF.
>>>>>>
>>>>>> I need to call some POST resources with different parameters. These
>>>>>> parameters are not primitive objects. I know that I can send primitive
>>>>>> objects without problems, but when I try to send other objects (no
>>>>>> primitives) I don't know how do it. I try to develop with RestEasy, but
>>>>>> my
>>>>>> OSGi container send me an error like: don't find RestEasy library,
>>>>>> when I
>>>>>> put into the container :(
>>>>>>
>>>>>> Where can I found examples about this? (REST+OSGi)
>>>>>>
>>>>>> Thanks in advance and sorry for the inconvenience.
>>>>>>
>>>>>>   np. You may have a look at a DOSGi CXF subproject or download a
>>>>> Karaf-based distribution with CXF preinstalled (ex, Talend ESB) and work
>>>>> with CXF JAX-RS client support, here is one link:
>>>>>
>>>>> https://github.com/Talend/****tesb-rt-se/blob/master/**<https://github.com/Talend/**tesb-rt-se/blob/master/**>
>>>>> examples/cxf/jaxrs-advanced/****service/src/main/resources/**
>>>>> META-INF/spring/beans.xml<http**s://github.com/Talend/tesb-rt-**
>>>>> se/blob/master/examples/cxf/**jaxrs-advanced/service/src/**
>>>>> main/resources/META-INF/**spring/beans.xml<https://github.com/Talend/tesb-rt-se/blob/master/examples/cxf/jaxrs-advanced/service/src/main/resources/META-INF/spring/beans.xml>
>>>>>>
>>>>>
>>>>>
>>>>> (shows Spring configured client loaded in Karaf, same can be done with
>>>>> Blueprint)
>>>>>
>>>>> HTH, Sergey
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>   Best regards, Jesus!!
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> Sergey Beryozkin
>>>>>
>>>>> Talend Community Coders
>>>>> http://coders.talend.com/
>>>>>
>>>>> Blog: http://sberyozkin.blogspot.com
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>



Re: REST client in ApacheFelix with CXF

Posted by elMateo <so...@gmail.com>.
Yes, I try to run and all is ok with this.

But the difference with my application is that I don't have a interface, I
only have multiple urls with resources, and I need to send some POST and
GET messages with two parameters to these resources

So, what I need for this?

Cheers, Jesus



On Thu, Oct 11, 2012 at 4:59 PM, Sergey Beryozkin <sb...@gmail.com>wrote:

> On 11/10/12 15:28, elMateo wrote:
>
>> Hello everybody
>>
>> I review this example and I try to use. Now, I'm
>> using cxf-dosgi-ri-singlebundle-**distribution to develop a REST client
>> into
>> my Apache Felix container. But I have some errors and I can't execute my
>> bundle :(
>>
>> Do I need more bundles, a part of cxf-dosgi-ri-singlebundle-**
>> distribution,
>> to develop a REST client into Felix?? Only with this bundle, Felix show me
>> an error because it don't find javax.ws.rs.core
>>
>
> Can you try to run a greeter_rest demo available in the distribution ?
>
> Cheers, Sergey
>
>
>
>> Thanks in advance!!
>>
>>
>>
>> On Thu, Oct 11, 2012 at 12:04 PM, elMateo<so...@gmail.com>  wrote:
>>
>>  Thanks a lot Sergey!!
>>>
>>> I'm going to review it.
>>>
>>>
>>> On Thu, Oct 11, 2012 at 11:58 AM, Sergey Beryozkin<sberyozkin@gmail.com*
>>> *>wrote:
>>>
>>>  Hi
>>>>
>>>> On 11/10/12 09:57, elMateo wrote:
>>>>
>>>>  Hello all, and sorry if it isn't the correct list to make this
>>>>> question.
>>>>>
>>>>> I need to develop a REST client into Felix and I'm not sure that I can
>>>>> make
>>>>> with CXF.
>>>>>
>>>>> I need to call some POST resources with different parameters. These
>>>>> parameters are not primitive objects. I know that I can send primitive
>>>>> objects without problems, but when I try to send other objects (no
>>>>> primitives) I don't know how do it. I try to develop with RestEasy, but
>>>>> my
>>>>> OSGi container send me an error like: don't find RestEasy library,
>>>>> when I
>>>>> put into the container :(
>>>>>
>>>>> Where can I found examples about this? (REST+OSGi)
>>>>>
>>>>> Thanks in advance and sorry for the inconvenience.
>>>>>
>>>>>  np. You may have a look at a DOSGi CXF subproject or download a
>>>> Karaf-based distribution with CXF preinstalled (ex, Talend ESB) and work
>>>> with CXF JAX-RS client support, here is one link:
>>>>
>>>> https://github.com/Talend/****tesb-rt-se/blob/master/**<https://github.com/Talend/**tesb-rt-se/blob/master/**>
>>>> examples/cxf/jaxrs-advanced/****service/src/main/resources/**
>>>> META-INF/spring/beans.xml<http**s://github.com/Talend/tesb-rt-**
>>>> se/blob/master/examples/cxf/**jaxrs-advanced/service/src/**
>>>> main/resources/META-INF/**spring/beans.xml<https://github.com/Talend/tesb-rt-se/blob/master/examples/cxf/jaxrs-advanced/service/src/main/resources/META-INF/spring/beans.xml>
>>>> >
>>>>
>>>>
>>>> (shows Spring configured client loaded in Karaf, same can be done with
>>>> Blueprint)
>>>>
>>>> HTH, Sergey
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  Best regards, Jesus!!
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Sergey Beryozkin
>>>>
>>>> Talend Community Coders
>>>> http://coders.talend.com/
>>>>
>>>> Blog: http://sberyozkin.blogspot.com
>>>>
>>>>
>>>
>>>
>>
>

Re: REST client in ApacheFelix with CXF

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 11/10/12 15:28, elMateo wrote:
> Hello everybody
>
> I review this example and I try to use. Now, I'm
> using cxf-dosgi-ri-singlebundle-distribution to develop a REST client into
> my Apache Felix container. But I have some errors and I can't execute my
> bundle :(
>
> Do I need more bundles, a part of cxf-dosgi-ri-singlebundle-distribution,
> to develop a REST client into Felix?? Only with this bundle, Felix show me
> an error because it don't find javax.ws.rs.core

Can you try to run a greeter_rest demo available in the distribution ?

Cheers, Sergey


>
> Thanks in advance!!
>
>
>
> On Thu, Oct 11, 2012 at 12:04 PM, elMateo<so...@gmail.com>  wrote:
>
>> Thanks a lot Sergey!!
>>
>> I'm going to review it.
>>
>>
>> On Thu, Oct 11, 2012 at 11:58 AM, Sergey Beryozkin<sb...@gmail.com>wrote:
>>
>>> Hi
>>>
>>> On 11/10/12 09:57, elMateo wrote:
>>>
>>>> Hello all, and sorry if it isn't the correct list to make this question.
>>>>
>>>> I need to develop a REST client into Felix and I'm not sure that I can
>>>> make
>>>> with CXF.
>>>>
>>>> I need to call some POST resources with different parameters. These
>>>> parameters are not primitive objects. I know that I can send primitive
>>>> objects without problems, but when I try to send other objects (no
>>>> primitives) I don't know how do it. I try to develop with RestEasy, but
>>>> my
>>>> OSGi container send me an error like: don't find RestEasy library, when I
>>>> put into the container :(
>>>>
>>>> Where can I found examples about this? (REST+OSGi)
>>>>
>>>> Thanks in advance and sorry for the inconvenience.
>>>>
>>> np. You may have a look at a DOSGi CXF subproject or download a
>>> Karaf-based distribution with CXF preinstalled (ex, Talend ESB) and work
>>> with CXF JAX-RS client support, here is one link:
>>>
>>> https://github.com/Talend/**tesb-rt-se/blob/master/**
>>> examples/cxf/jaxrs-advanced/**service/src/main/resources/**
>>> META-INF/spring/beans.xml<https://github.com/Talend/tesb-rt-se/blob/master/examples/cxf/jaxrs-advanced/service/src/main/resources/META-INF/spring/beans.xml>
>>>
>>> (shows Spring configured client loaded in Karaf, same can be done with
>>> Blueprint)
>>>
>>> HTH, Sergey
>>>
>>>
>>>
>>>
>>>
>>>
>>>> Best regards, Jesus!!
>>>>
>>>>
>>>
>>> --
>>> Sergey Beryozkin
>>>
>>> Talend Community Coders
>>> http://coders.talend.com/
>>>
>>> Blog: http://sberyozkin.blogspot.com
>>>
>>
>>
>


Re: REST client in ApacheFelix with CXF

Posted by elMateo <so...@gmail.com>.
Hello everybody

I review this example and I try to use. Now, I'm
using cxf-dosgi-ri-singlebundle-distribution to develop a REST client into
my Apache Felix container. But I have some errors and I can't execute my
bundle :(

Do I need more bundles, a part of cxf-dosgi-ri-singlebundle-distribution,
to develop a REST client into Felix?? Only with this bundle, Felix show me
an error because it don't find javax.ws.rs.core

Thanks in advance!!



On Thu, Oct 11, 2012 at 12:04 PM, elMateo <so...@gmail.com> wrote:

> Thanks a lot Sergey!!
>
> I'm going to review it.
>
>
> On Thu, Oct 11, 2012 at 11:58 AM, Sergey Beryozkin <sb...@gmail.com>wrote:
>
>> Hi
>>
>> On 11/10/12 09:57, elMateo wrote:
>>
>>> Hello all, and sorry if it isn't the correct list to make this question.
>>>
>>> I need to develop a REST client into Felix and I'm not sure that I can
>>> make
>>> with CXF.
>>>
>>> I need to call some POST resources with different parameters. These
>>> parameters are not primitive objects. I know that I can send primitive
>>> objects without problems, but when I try to send other objects (no
>>> primitives) I don't know how do it. I try to develop with RestEasy, but
>>> my
>>> OSGi container send me an error like: don't find RestEasy library, when I
>>> put into the container :(
>>>
>>> Where can I found examples about this? (REST+OSGi)
>>>
>>> Thanks in advance and sorry for the inconvenience.
>>>
>> np. You may have a look at a DOSGi CXF subproject or download a
>> Karaf-based distribution with CXF preinstalled (ex, Talend ESB) and work
>> with CXF JAX-RS client support, here is one link:
>>
>> https://github.com/Talend/**tesb-rt-se/blob/master/**
>> examples/cxf/jaxrs-advanced/**service/src/main/resources/**
>> META-INF/spring/beans.xml<https://github.com/Talend/tesb-rt-se/blob/master/examples/cxf/jaxrs-advanced/service/src/main/resources/META-INF/spring/beans.xml>
>>
>> (shows Spring configured client loaded in Karaf, same can be done with
>> Blueprint)
>>
>> HTH, Sergey
>>
>>
>>
>>
>>
>>
>>> Best regards, Jesus!!
>>>
>>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>> Blog: http://sberyozkin.blogspot.com
>>
>
>

Re: REST client in ApacheFelix with CXF

Posted by elMateo <so...@gmail.com>.
Thanks a lot Sergey!!

I'm going to review it.


On Thu, Oct 11, 2012 at 11:58 AM, Sergey Beryozkin <sb...@gmail.com>wrote:

> Hi
>
> On 11/10/12 09:57, elMateo wrote:
>
>> Hello all, and sorry if it isn't the correct list to make this question.
>>
>> I need to develop a REST client into Felix and I'm not sure that I can
>> make
>> with CXF.
>>
>> I need to call some POST resources with different parameters. These
>> parameters are not primitive objects. I know that I can send primitive
>> objects without problems, but when I try to send other objects (no
>> primitives) I don't know how do it. I try to develop with RestEasy, but my
>> OSGi container send me an error like: don't find RestEasy library, when I
>> put into the container :(
>>
>> Where can I found examples about this? (REST+OSGi)
>>
>> Thanks in advance and sorry for the inconvenience.
>>
> np. You may have a look at a DOSGi CXF subproject or download a
> Karaf-based distribution with CXF preinstalled (ex, Talend ESB) and work
> with CXF JAX-RS client support, here is one link:
>
> https://github.com/Talend/**tesb-rt-se/blob/master/**
> examples/cxf/jaxrs-advanced/**service/src/main/resources/**
> META-INF/spring/beans.xml<https://github.com/Talend/tesb-rt-se/blob/master/examples/cxf/jaxrs-advanced/service/src/main/resources/META-INF/spring/beans.xml>
>
> (shows Spring configured client loaded in Karaf, same can be done with
> Blueprint)
>
> HTH, Sergey
>
>
>
>
>
>
>> Best regards, Jesus!!
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>

Re: REST client in ApacheFelix with CXF

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 11/10/12 09:57, elMateo wrote:
> Hello all, and sorry if it isn't the correct list to make this question.
>
> I need to develop a REST client into Felix and I'm not sure that I can make
> with CXF.
>
> I need to call some POST resources with different parameters. These
> parameters are not primitive objects. I know that I can send primitive
> objects without problems, but when I try to send other objects (no
> primitives) I don't know how do it. I try to develop with RestEasy, but my
> OSGi container send me an error like: don't find RestEasy library, when I
> put into the container :(
>
> Where can I found examples about this? (REST+OSGi)
>
> Thanks in advance and sorry for the inconvenience.
np. You may have a look at a DOSGi CXF subproject or download a 
Karaf-based distribution with CXF preinstalled (ex, Talend ESB) and work 
with CXF JAX-RS client support, here is one link:

https://github.com/Talend/tesb-rt-se/blob/master/examples/cxf/jaxrs-advanced/service/src/main/resources/META-INF/spring/beans.xml

(shows Spring configured client loaded in Karaf, same can be done with 
Blueprint)

HTH, Sergey





>
> Best regards, Jesus!!
>


-- 
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com