This is exactly what RESTful service can do here.
Take a look at cxf-jaxrs example shipped with kit.
Thank you for the information.
Is there the possibility to use the full power of camle routes
within this scenario ?
E.g use sql compoment to perform select statement, use xslt component to prepare response......
Is it possible to use jax-ws instead of REST e.g starting point example cxf-ws-security-osgi ?
Of course you can use jaxws instead of REST(jaxrs), but your scenario(this kind of CRUD operation) is more suitable of using RESTful service.
If you wanna use camel router, I recommend you to use camel-cxf or camel-cxfrs to handle the request.
I started with the example http://camel.apache.org/cxfrs.html
I adapted the cxf-jaxrs example since it has already the required beans.
My Bundle is active but when I type the URL into the browser
I got an exception in the log file
Interceptor for WebClient has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message.
Ok, if I am right we have different ports/urls for the request and the response and my browser cannot handle it but I don't know how to write a client for that.
Is there a complete example for http://camel.apache.org/cxfrs.html available in svn ?
The next steps to reach my goal are also not clear for me.
I'd like to do:
I solved the first part..... I had a typo in my beans.xml
Communication works with url
Can you explain me the communication between jaxrs:server,cxf:rsServer and cxf:rsClient ?
Do I have to add two Service beans for cxf:rsServer and cxf:rsClient ?
The first on which picks up the id from cxf:rsServer , provide it to an sql step, a bean which processes the result and add a customer object to the payload and provide this to the cxf:rsClient ?
I need some further help !!
My bundle starts, the sql is executed succesful (I can see the output in the log) but my response is not as expected.
I am still not sure how to setup the beans for jaxrs:server,cxf:rsServer and cxf:rsClient....
it seems that only the bean from cxf:rsClient takes affect....
Can somebody give me a hint ?
Sorry..... me again.
Since I want to use the power of camel within my route based on http://camel.apache.org/cxfrs.html I need help, otherwise I have to impelment my requirements by myself (adapt the CustomerService Bean to perform sql , sql processing and return) and I don't think that this is the right way.
I need a way to change the Customer bean in my camel route..... but I do not have any idea (or better all my ideas caused an errror or the return is still the object created in the init method of CustomerService bean)
If you have a route like this:
<route> <from uri="cxfrs://bean://rsServer"></from> ..... send the provided id to payload ..... perform sql with the id ..... create Customer Object from result set and send back to client <to uri="cxfrs://bean://rsClient"></to> </route>
Then you do not need that last step, to send back the reply to the client. Instead when the route ends, then the consumer (eg in the ) will send back the reply to the client.
So instead do something like
<from uri="cxfrs://bean://rsServer"/> ..... send the provided id to payload ..... perform sql with the id ..... create Customer Object from result set
This hint solved my problem. (try to mark it as helpful and correct but only the first choice has been accepted)
Thanks a lot