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
i have create a interface.
@Path("/licence") public interface LicenceThresholdService { @POST @Consumes({MediaType.APPLICATION_JSON}) @Path("/userThresholdBreached") Boolean isUsersThresholdBreached(User user); }
Implementation class
public class LicenceThresholdServiceImpl implements LicenceThresholdService { @Override public Boolean isUsersThresholdBreached(final OEMUser user) { System.out.println("inside threshold breched method"); return Boolean.FALSE; } }
Create the cxf jaxrs server
<beans ... xmlns:cxf="http://camel.apache.org/schema/cxf" ... xsi:schemaLocation=" http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd ..."> <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>
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. I am using the redhat fuse esb.
Please help me out for this issue, this is a serious concern for us to go with camel.