Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7843761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:39:15+00:00 2026-06-02T16:39:15+00:00

i have a restful webservice configured using cxf and camel. My config xml is

  • 0

i have a restful webservice configured using cxf and camel. My config xml is :

<jaxrs:server id="restContainer" address="/" staticSubresourceResolution="true"> <jaxrs:serviceBeans>  
<ref bean="FooBar" />
  </jaxrs:serviceBeans> 
 <jaxrs:providers>  
<bean class="org.apache.cxf.jaxrs.provider.JSONProvider">
  <property name="dropRootElement" value="true" /> 
 <property name="supportUnwrapped" value="true" /> 
 </jaxrs:providers>  
<camelcxf:rsServer id="rsServer" address="/" serviceClass="com.camel.example.FooBar" /> <camel:camelContext id="camelContext-1">  
<camel:route> 
 <camel:from uri="cxfrs:bean:rsServer" />  
<camel:to uri="http://localhost:8080/Google/rest/search" />  
</camel:route>  
</camel:camelContext> 

Now i have FooBar class which is exposed as a service and is like this :

@Service("Demo") @Path("/foo/bar") public class FooBar{

       @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public PoiDetailsResponse poiGetDetails(
            PoiDetailsRequest json)
    {
        System.out.println(json.getUname());
        System.out.println(json.getDeviceid());
        //do some validation and some business logic
        //return accordingly;
    }

My concern is that when i hit my server .. camelContext takes over immediately and the method present in my class is not at all touched .. infact whatever response comes from my “to” part of the route is send back to the client.. now one way is that i add multiple processor for every businesss logic. but i really want to have my method executed first and then route starts .. how can i do this ?? Also i can hit my server with whatever parameters i want, even if they are wrong (meaning wrong datatypes of variables of PoiDetailsRequest) and get any response parameters (which are not part of PoiDetailsResponse), this is ofcourse not a good thing.. please suggest something..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:39:16+00:00Added an answer on June 2, 2026 at 4:39 pm

    You dont need to use the Camel cxfrs component if you want to expose a RS service and use the service bean. You can just use plain CXF RS for this.

    The Camel cxfrs component is for when you want to let the RS service route directly into the Camel route.

    If you want your method executed first, then you can from your method call Camel by using the ProducerTemplate to send a message to a Camel route using the direct endpoint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using cxf 2.4.4 to make RESTful webservices I have this service: @WebService public
I have a restful web service based on cxf and camel. I am using
I am using Jersey and JAXB to build a simple RESTful webservice I have
I have a Flex client making RESTful calls to a webservice using HTTPService. The
I have a restful webservice build on CXF framework. the requirement is that when
I want to retrieve data from restful webservice that returns xml. I'm using phonegap.
We have developed a RESTful webservice using the restlet framework. The service is called
I have a restful webservice which receives some structured data which is put straight
I currently have a RESTful webservice which recognises a client via it's session. I
I have created a RESTful PHP web service using Lithium which contains comments, each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.