-
1. Re: RESTproxy?
scottdawson Dec 8, 2010 3:26 PM (in response to izgur)Yes, you can proxy REST services using the http-gateway for incoming requests (see the http_gateway quickstart for examples) and use an HttpRouter action to invoke the proxied service. So the configuration will be something like this:
<listeners>
<http-gateway name="myrest" />
</listeners>
<actions ...
<action name="httprouter" class="org.jboss.soa.esb.actions.routing.http.HttpRouter">
<property name="endpointUrl" value="http://www.example.com/rss/feed.jsp?id=1234"/>
<property name="method" value="GET"/>
<property name="responseType" value="STRING"/>
</action>
...Regards,
Scott
-
2. Re: RESTproxy?
izgur Dec 8, 2010 3:30 PM (in response to scottdawson)Thanks for replying!
My REST service that i want to call over my ESB goes like makeCall?callingnumber=034242&callednumber=....
So my proxy REST service(on ESB) must be able to pass the parameters that he got from the call. Can the parameters be passed?Like the id in your example. It looks like u hardcoded 1234...
BR, Igor!
-
3. Re: RESTproxy?
scottdawson Dec 15, 2010 9:29 AM (in response to izgur)>> Can the parameters be passed?
Yes, I think so. You can get the query parameters and other path information from the HttpRequest object -- see http://community.jboss.org/wiki/HTTPGateway
Then use the technique shown in the second post here: http://community.jboss.org/message/575651#575651 -- dynamically create the HttpRouter so that you can set the endpointUrl at runtime.
Regards,
Scott
-