-
1. Re: CXFRS with interface and passthrough
davsclaus Jan 27, 2011 1:12 AM (in response to sysgen)What version of Camel and CXF are you using?
-
2. Re: CXFRS with interface and passthrough
sysgen Jan 27, 2011 2:06 AM (in response to davsclaus)4.3.0-fuse-03
-
3. Re: CXFRS with interface and passthrough
davsclaus Jan 27, 2011 5:45 AM (in response to sysgen)I would assume CXF-RS would be able to handle marshaling/unmarshal automatic. So all you have to do is to code as if it was java code.
The return type of the operation is List instance containing the response.
Then you dont need the xstream at all.
-
4. Re: CXFRS with interface and passthrough
davsclaus Jan 27, 2011 5:46 AM (in response to sysgen)And yeah I think it would be nice if JAX-RS would accept an annotated interface instead of a class.
You can create a JIRA ticket at Apache Camel for this enhancement
-
5. Re: CXFRS with interface and passthrough
davsclaus Jan 27, 2011 5:47 AM (in response to sysgen)We are having a number of webinars on using CXF so you may be interested to attend those.
http://fusesource.com/resources/video-archived-webinars/
The webinars will be recorded and avail for viewing later.
-
6. Re: CXFRS with interface and passthrough
sysgen Jan 27, 2011 8:09 AM (in response to davsclaus)What I dont understand is how a concrete class at this point would look and function.
Each method on the class requires a return type of List JAX-RS response) ???
-
7. Re: CXFRS with interface and passthrough
davsclaus Jan 27, 2011 10:08 AM (in response to sysgen)To store in the database its much easier to use SpringJdbcTemplate in Java code. That allows you to provide the SQL and bind the parameters.
But using the camel jdbc or sql component is also applicable. However you need to transform the message body beforehand.
So instead you can just do
from
process(new MyDatabaseProcessor())
process(new MyResponseProcessor())
And then use a Camel Processor to leverage the Spring JdbcTemplate
And the last Camel processor to set the response.
Instead of using a Camel processor you can use beans if you prefer that.
http://camel.apache.org/bean-binding.html
Chapter 3 and 4 in the Camel book covers this in much more depth.