You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Julio Carlos Barrera Juez <ju...@i2cat.net> on 2013/07/04 12:40:28 UTC

Publish CXF REST WS dinamically

Hi.

I want to publish REST WS without having an annotated interface or class. I
mean, the endpoint are not known a priori, then I need to publish it
programmatically. It is possible to do it without reflection or this kind
of approach? I need some starting point to read documentation and acquire
some concepts I don't have now.

Thank you.

Re: Publish CXF REST WS dinamically

Posted by Julio Carlos Barrera Juez <ju...@i2cat.net>.
This solution is great, Sergey! It is what I was exactly looking for!

Thank you so much!


On 5 July 2013 12:07, Sergey Beryozkin <sb...@gmail.com> wrote:

> You can use user model classes, see:
>
> http://svn.apache.org/repos/**asf/cxf/trunk/systests/jaxrs/**
> src/test/java/org/apache/cxf/**systest/jaxrs/**
> JAXRSClientServerUserResourceT**est.java<http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java>
>
> Cheers, Sergey
>
> On 05/07/13 09:06, Julio Carlos Barrera Juez wrote:
>
>> Yes, it helps. I will generate the XML dinamycally.
>>
>> Thank you.
>>
>>
>> On 4 July 2013 14:34, Sergey Beryozkin <sb...@gmail.com> wrote:
>>
>>  Hi
>>>
>>> On 04/07/13 12:40, Julio Carlos Barrera Juez wrote:
>>>
>>>  Hi.
>>>>
>>>> I want to publish REST WS without having an annotated interface or
>>>> class.
>>>> I
>>>> mean, the endpoint are not known a priori, then I need to publish it
>>>> programmatically. It is possible to do it without reflection or this
>>>> kind
>>>> of approach? I need some starting point to read documentation and
>>>> acquire
>>>> some concepts I don't have now.
>>>>
>>>>
>>> You can use this feature:
>>>
>>> http://cxf.apache.org/docs/****jax-rs-advanced-features.html#****<http://cxf.apache.org/docs/**jax-rs-advanced-features.html#**>
>>> JAX-RSAdvancedFeatures-****RESTfulserviceswithoutannotati****ons<
>>> http://cxf.apache.org/**docs/jax-rs-advanced-features.**
>>> html#JAX-RSAdvancedFeatures-**RESTfulserviceswithoutannotati**ons<http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations>
>>> >
>>>
>>>
>>> So if you have some dynamic objects coming in and they have no
>>> annotations, you can attach a user model to it (programmatically or
>>> statically) and publish them
>>>
>>> Does it help ?
>>>
>>> Sergey
>>>
>>>
>>>  Thank you.
>>>>
>>>>
>>>>
>>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>

Re: Publish CXF REST WS dinamically

Posted by Sergey Beryozkin <sb...@gmail.com>.
You can use user model classes, see:

http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java

Cheers, Sergey
On 05/07/13 09:06, Julio Carlos Barrera Juez wrote:
> Yes, it helps. I will generate the XML dinamycally.
>
> Thank you.
>
>
> On 4 July 2013 14:34, Sergey Beryozkin <sb...@gmail.com> wrote:
>
>> Hi
>>
>> On 04/07/13 12:40, Julio Carlos Barrera Juez wrote:
>>
>>> Hi.
>>>
>>> I want to publish REST WS without having an annotated interface or class.
>>> I
>>> mean, the endpoint are not known a priori, then I need to publish it
>>> programmatically. It is possible to do it without reflection or this kind
>>> of approach? I need some starting point to read documentation and acquire
>>> some concepts I don't have now.
>>>
>>
>> You can use this feature:
>>
>> http://cxf.apache.org/docs/**jax-rs-advanced-features.html#**
>> JAX-RSAdvancedFeatures-**RESTfulserviceswithoutannotati**ons<http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations>
>>
>> So if you have some dynamic objects coming in and they have no
>> annotations, you can attach a user model to it (programmatically or
>> statically) and publish them
>>
>> Does it help ?
>>
>> Sergey
>>
>>
>>> Thank you.
>>>
>>>
>>
>


-- 
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com

Re: Publish CXF REST WS dinamically

Posted by Julio Carlos Barrera Juez <ju...@i2cat.net>.
Yes, it helps. I will generate the XML dinamycally.

Thank you.


On 4 July 2013 14:34, Sergey Beryozkin <sb...@gmail.com> wrote:

> Hi
>
> On 04/07/13 12:40, Julio Carlos Barrera Juez wrote:
>
>> Hi.
>>
>> I want to publish REST WS without having an annotated interface or class.
>> I
>> mean, the endpoint are not known a priori, then I need to publish it
>> programmatically. It is possible to do it without reflection or this kind
>> of approach? I need some starting point to read documentation and acquire
>> some concepts I don't have now.
>>
>
> You can use this feature:
>
> http://cxf.apache.org/docs/**jax-rs-advanced-features.html#**
> JAX-RSAdvancedFeatures-**RESTfulserviceswithoutannotati**ons<http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations>
>
> So if you have some dynamic objects coming in and they have no
> annotations, you can attach a user model to it (programmatically or
> statically) and publish them
>
> Does it help ?
>
> Sergey
>
>
>> Thank you.
>>
>>
>

Re: Publish CXF REST WS dinamically

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 04/07/13 12:40, Julio Carlos Barrera Juez wrote:
> Hi.
>
> I want to publish REST WS without having an annotated interface or class. I
> mean, the endpoint are not known a priori, then I need to publish it
> programmatically. It is possible to do it without reflection or this kind
> of approach? I need some starting point to read documentation and acquire
> some concepts I don't have now.

You can use this feature:

http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations

So if you have some dynamic objects coming in and they have no 
annotations, you can attach a user model to it (programmatically or 
statically) and publish them

Does it help ?

Sergey

>
> Thank you.
>