You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Adnan Memon <me...@gmail.com> on 2008/05/08 00:51:58 UTC

SOAP to REST

Hi All,

We are using XFire SOAP for contract first, annotation based web  
services ...  we have a new requirement to support the RESTful  
services for existing interfaces.

Somewhere in CFX manual I read (If I remember correctly ?!) CFX have  
some bindings support or some feature that I can use to expose my  
existing SOAP web services as RESTful services without adding  
boilerplate code?

-
Adnan Memon


Re: SOAP to REST

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

Sorry for a slow response...I've updated the documentation at weekends

http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html,

hopefully it can help you to get started, there's a section on combining JAX-WS and JAX-RS, the initial info there may not cover all 
the edge cases, but we'll add more info there as necessary...

Cheers, Sergey


----- Original Message ----- 
From: "Adnan Memon" <me...@gmail.com>
To: <us...@cxf.apache.org>
Sent: Friday, May 09, 2008 8:04 AM
Subject: Re: SOAP to REST


> Hi Sergey,
>
> Appreciate your help.
>
> Can you point me to any sample app or URL where I can find the  documentation for this?
>
>
> Thanks.
>
> -
> Adnan Memon
> memon.adnan@gmail.com
>
> On May 8, 2008, at 10:38 AM, Sergey Beryozkin wrote:
>
>> Hi
>>
>>> We are using XFire SOAP for contract first, annotation based web
>>> services ...  we have a new requirement to support the RESTful
>>> services for existing interfaces.
>>
>> This should be fairly straighforward if you can use Spring, though  programmatically it also can be achieved.
>> For example you might want to refer to your JAX-WS service bean from  a JAX-RS server configuration :
>>
>> <bean class="com.ServiceClass" id="serviceClass"/>
>>
>> <jaxws:endpoint ... implementor="#serviceClass"/>
>>
>> <jaxrs:server address="/rest">
>>    <jaxrs:serviceBeans>
>>      <bean ref="serviceClass" />
>>    </jaxrs:serviceBeans>
>> </jaxrs:server>
>>
>>
>> Then you'd need to add JAX-RS annotations to your JAX-RS service  class, they will coexist fine with the existing JAX-WS 
>> annotations.  You may also need to provide some custom JAX-RS MessageBodyWriters/ Readers, depending on what types are being 
>> returned/accepted.
>>
>> Cheers, Sergey
>>
>>
>>
>>> Hi All,
>>>
>>> We are using XFire SOAP for contract first, annotation based web
>>> services ...  we have a new requirement to support the RESTful
>>> services for existing interfaces.
>>>
>>> Somewhere in CFX manual I read (If I remember correctly ?!) CFX have
>>> some bindings support or some feature that I can use to expose my
>>> existing SOAP web services as RESTful services without adding
>>> boilerplate code?
>>>
>>> -
>>> Adnan Memon
>>
>> ----------------------------
>> IONA Technologies PLC (registered in Ireland)
>> Registered Number: 171387
>> Registered Address: The IONA Building, Shelbourne Road, Dublin 4,  Ireland 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: SOAP to REST

Posted by Adnan Memon <me...@gmail.com>.
Hi Sergey,

Appreciate your help.

Can you point me to any sample app or URL where I can find the  
documentation for this?


Thanks.

-
Adnan Memon
memon.adnan@gmail.com

On May 8, 2008, at 10:38 AM, Sergey Beryozkin wrote:

> Hi
>
>> We are using XFire SOAP for contract first, annotation based web
>> services ...  we have a new requirement to support the RESTful
>> services for existing interfaces.
>
> This should be fairly straighforward if you can use Spring, though  
> programmatically it also can be achieved.
> For example you might want to refer to your JAX-WS service bean from  
> a JAX-RS server configuration :
>
> <bean class="com.ServiceClass" id="serviceClass"/>
>
> <jaxws:endpoint ... implementor="#serviceClass"/>
>
> <jaxrs:server address="/rest">
>    <jaxrs:serviceBeans>
>      <bean ref="serviceClass" />
>    </jaxrs:serviceBeans>
> </jaxrs:server>
>
>
> Then you'd need to add JAX-RS annotations to your JAX-RS service  
> class, they will coexist fine with the existing JAX-WS annotations.  
> You may also need to provide some custom JAX-RS MessageBodyWriters/ 
> Readers, depending on what types are being returned/accepted.
>
> Cheers, Sergey
>
>
>
>> Hi All,
>>
>> We are using XFire SOAP for contract first, annotation based web
>> services ...  we have a new requirement to support the RESTful
>> services for existing interfaces.
>>
>> Somewhere in CFX manual I read (If I remember correctly ?!) CFX have
>> some bindings support or some feature that I can use to expose my
>> existing SOAP web services as RESTful services without adding
>> boilerplate code?
>>
>> -
>> Adnan Memon
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4,  
> Ireland


Re: SOAP to REST

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

> We are using XFire SOAP for contract first, annotation based web  
> services ...  we have a new requirement to support the RESTful  
> services for existing interfaces.

This should be fairly straighforward if you can use Spring, though programmatically it also can be achieved.
For example you might want to refer to your JAX-WS service bean from a JAX-RS server configuration :

<bean class="com.ServiceClass" id="serviceClass"/>

<jaxws:endpoint ... implementor="#serviceClass"/>

<jaxrs:server address="/rest">
    <jaxrs:serviceBeans>
      <bean ref="serviceClass" />
    </jaxrs:serviceBeans>
</jaxrs:server>


Then you'd need to add JAX-RS annotations to your JAX-RS service class, they will coexist fine with the existing JAX-WS annotations. You may also need to provide some custom JAX-RS MessageBodyWriters/Readers, depending on what types are being returned/accepted.

Cheers, Sergey



> Hi All,
> 
> We are using XFire SOAP for contract first, annotation based web  
> services ...  we have a new requirement to support the RESTful  
> services for existing interfaces.
> 
> Somewhere in CFX manual I read (If I remember correctly ?!) CFX have  
> some bindings support or some feature that I can use to expose my  
> existing SOAP web services as RESTful services without adding  
> boilerplate code?
> 
> -
> Adnan Memon 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland