Hi
I have an external REST service, that I want to make available through
ServiceMix. For the service I have build a HTTP Provider SU, which looks
like this:
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:weather="http://servicemix.apache.org/weatherServiceMix">
<http:endpoint service="weather:restService"
endpoint="restEndpoint"
role="provider"
locationURI="http://localhost:8380/HumidityRestService-1.0.0/humidity"
defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
soap="false" />
</beans>
The REST service returns a String that shall be passed back to the caller.
But this is where I got stuck. How can I write a SU that can send request to
my weather:restService and pass back the replies?
I was thinking about some ways to achieve that. First I thought about a
quartz that invokes my service in a given interval but I do not know how and
where the result of the REST service can be passed to some other SU that can
put it on e.g. a JMS queue.
I was also thinking that I use a JMS consumer that can receive message from
a client outside ServiceMix and then calls my weather:restService but again
I did not know how the result can be passed back to the Client who initially
send a JMS message.
I further looked at the beans components but could not find any example
where a beans initiates a MessageExchange, all examples only show the
onMessageExchange() method, which is invoked when a message is received.
Do you have any suggestions for me how I can make the REST service available
through ServiceMix to clients outside ServiceMix. It should be some kind of
bridge component at the, perhaps like the bridge example, but the other way
round.
Are there any examples how a HTTP provider endpoint can be invoked within
ServiceMix? I did not find any for that?
Thanks
Robert