camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Camel CXF Jaxrs service implementation class's methods are not executing
Date Thu, 03 Apr 2014 17:02:45 GMT
This is specific to CXFRS server, it only acts as a matcher, and then 
sets various matched values on the Camel exchange.

I guess you may want to use cxfrs bean...

Also feel free to experiment with Camel restlet/http/jetty, etc.

Re CXF: you can have native CXF JAX-RS server endpoint containing an 
implementation class used inside Camel and get it invoked via Camel 
transport.

Sergey

On 03/04/14 17:47, vrahul wrote:
> Hi,
>
> I am confused with the behaviour of cxf rest web service with camel route
> file. I have noticed the control never go inside the implementing class of
> the rest service interface.
>
> Following are the steps how i am writing the web service using cxf jaxrs and
> camel
>
> 1. i have create a interface.
>      @Path("/licence")
> public interface LicenceThresholdService {
>      @POST
>      @Consumes({MediaType.APPLICATION_JSON})
>      @Path("/userThresholdBreached")
>      Boolean isUsersThresholdBreached(User user);
> }
>
> 2. Implementation class
>      public class LicenceThresholdServiceImpl implements
> LicenceThresholdService {
>      @Override
>      public Boolean isUsersThresholdBreached(final OEMUser user) {
> 		System.out.println("inside threshold breched method");
>          return Boolean.FALSE;
>      }
>   }
>
> 3. Create the cxf jaxrs server
>
>     <beans ...
> 	xmlns:cxf=&quot;http://camel.apache.org/schema/cxf&quot;
>      ...
> 	xsi:schemaLocation=&quot;
>           http://camel.apache.org/schema/cxf
>           http://camel.apache.org/schema/cxf/camel-cxf.xsd
>          ...&quot;>
>
> 	<cxf:rsServer id="userProfileService"
> 		address="http://{{service.host}}:{{service.port}}/userProfile"
> 		serviceClass="com.jato.esb.service.licence.LicenceThresholdServiceImpl"
> 		loggingFeatureEnabled="true">
> 		<cxf:providers>
>              <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
>          </cxf:providers>
> 	</cxf:rsServer>
> </beans>
>
> 4. injected the cxf rsServer bean in camel route endpoint
>       <from uri="cxfrs://bean://userProfileService" />
>
> Now my problem is whenever i call this service, control never went inside
> isUsersThresholdBreached method of LicenceThresholdServiceImpl  class.
> Because of this i am not able to fully leverage the cxf rest services.
> I have tried the cxf rest service with Mule esb and Spring application file,
> i have noticed that control always went inside the implementation class
> also, but this is not the case with camel route.
> Please help me out for this issue, this is a serious concern for us to go
> with camel.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-CXF-Jaxrs-service-implementation-class-s-methods-are-not-executing-tp5749733.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com

Mime
View raw message