-
1. Re: consume external rest services
Keith Babo Mar 26, 2013 7:26 PM (in response to Henrique Oliveira)You can use a RESTEasy binding for references to interact with RESTful services. There's an example of doing that in the rest-binding quickstart:
https://github.com/kcbabo/quickstarts/tree/master/rest-binding
First step would be to construct a JAX-RS client interface that maps to the resource URL. Not sure how pretty that particular resource path is going to look when mapped to JAX-RS. Once you have the resource interface, you just need a custom message composer to set the JAX-RS method parameters based on the input message.
Another option would be to use the HTTP binding, but we don't currently support constructing the target URL dynamically (e.g. based on message content). Interesting enhancement for the future.
-
2. Re: consume external rest services
Henrique Oliveira Mar 27, 2013 2:41 PM (in response to Keith Babo)In this case I can't use the RestEasy binding, because the service has many query parameters, and the switchyard-component-resteasy allow none or one parameter (the method org.switchyard.component.common.rest.RsMethodUtil.parseResources make this validation on component start).
Another negative point that I see is the amount of extra code to mapping the resources, when I need just modify the value of query strings.
The HTTP binding with the possibility to change/construct the URL dynamically will be the perfect in this case.
Thank you.
-
3. Re: consume external rest services
Keith Babo Mar 27, 2013 2:53 PM (in response to Henrique Oliveira)One of the features in 0.8 was to allow multiple parameters in your JAX-RS resource interface. The service interface will only have a single parameter and the custom message composer is used to reconcile the two.
I have filed a JIRA for the HTTP binding enhancement: