You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christopher Richmond <cr...@referentia.com> on 2010/11/05 23:47:12 UTC

CXF annotations for other data formats

Is it possible via CXF and it’s associated tools, to create one service
interface class with one implementation class and simply annotate that
interface so that it can be accessed via standard SOAP/WSDl as well as
REST(XML/JSON) all by just annotating the same interface class?


Thanks…

Re: CXF annotations for other data formats

Posted by Sergey Beryozkin <sb...@gmail.com>.
See for example

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

I'm presuming your 'also' comment was meant for this thread, so if you can
not use Spring then you will likely need to use CXFNonSpringServlet and
CXFNonSpringJAXRSServlet for SOAP and REST (JAXRS) respectively...What I do
not know is how to ensure that the same instance (of this interface
implementation) is used in such cases, when this servlets are declared in
web.xml, which is straightforward when Spring is involved.

We will be looking further into enhancing the way SOAP and REST services can
coexist so reusing the same instance (with no Spring) is something we should
probably look at...

If you use embedded Jetty for example then you will be able to do it by
explicitly creating an instance and reusing it during the endpoint
creation...

cheers, Sergey

On Fri, Nov 5, 2010 at 10:47 PM, Christopher Richmond <
crichmond@referentia.com> wrote:

> Is it possible via CXF and it’s associated tools, to create one service
> interface class with one implementation class and simply annotate that
> interface so that it can be accessed via standard SOAP/WSDl as well as
> REST(XML/JSON) all by just annotating the same interface class?
>
>
> Thanks…
>