You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jaybytez <ja...@yahoo.com> on 2013/06/27 07:27:51 UTC

JAX-RS with annotations on Interface not Implementation

Just a quick newbie question on JAX-RS with CXF (I have done a ton of JAX-WS
work with CXF).

I am trying to do something I was able to with JAX-WS/CXF and that is put
the JAX-RS annotations on the Interface and then provide the functionality
in the Implementation class.

If I do this, how would I configure the jaxrs:server (SampleProxyApi is my
Interface and SampleProxyApiImpl is my Implementation)

	<jaxrs:server 
		id="jaxrs.SampleProxyApi"> 
		<jaxrs:serviceBeans>
      		<bean id="twitterProxyApi" class="com.foo.SampleProxyApi"/>
    	</jaxrs:serviceBeans>
    	<jaxrs:providers>
      		<bean id="twitterProxyApi" class="com.foo.SampleProxyApiImpl"/>
    	</jaxrs:providers>
  		<jaxrs:extensionMappings>
    		<entry key="json" value="application/json"/>
    		<entry key="xml" value="application/xml"/>
  		</jaxrs:extensionMappings>
	</jaxrs:server>

Not sure I have this correct because when I deploy it to WebLogic, I am not
able to invoke the service.



--
View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-with-annotations-on-Interface-not-Implementation-tp5729914.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JAX-RS with annotations on Interface not Implementation

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 27/06/13 06:27, jaybytez wrote:
> Just a quick newbie question on JAX-RS with CXF (I have done a ton of JAX-WS
> work with CXF).
>
> I am trying to do something I was able to with JAX-WS/CXF and that is put
> the JAX-RS annotations on the Interface and then provide the functionality
> in the Implementation class.
>
> If I do this, how would I configure the jaxrs:server (SampleProxyApi is my
> Interface and SampleProxyApiImpl is my Implementation)
>
> 	<jaxrs:server
> 		id="jaxrs.SampleProxyApi">
> 		<jaxrs:serviceBeans>
>        		<bean id="twitterProxyApi" class="com.foo.SampleProxyApi"/>
>      	</jaxrs:serviceBeans>
>      	<jaxrs:providers>
>        		<bean id="twitterProxyApi" class="com.foo.SampleProxyApiImpl"/>
>      	</jaxrs:providers>
>    		<jaxrs:extensionMappings>
>      		<entry key="json" value="application/json"/>
>      		<entry key="xml" value="application/xml"/>
>    		</jaxrs:extensionMappings>
> 	</jaxrs:server>
>
> Not sure I have this correct because when I deploy it to WebLogic, I am not
> able to invoke the service.
>
<jaxrs:server
		id="jaxrs.SampleProxyApi">
  		<jaxrs:serviceBeans>
         		<bean id="twitterProxyApi" class="com.foo.SampleProxyApiImpl"/>
       	</jaxrs:serviceBeans>
</jaxrs:server>

will do it

Cheers, Sergey
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-with-annotations-on-Interface-not-Implementation-tp5729914.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com