Webservice Call

Nov 7, 2013 at 10:57 AM
How can we call the Web service using service bus. We are using service bus in our project for one way communication. All the communication done using API controller(Web API). Although there is send method which takes object as argument, how i can send the web service url through shuttle bus.
Can anyone help me to sort out this?

Thanks in advance
Coordinator
Nov 7, 2013 at 12:43 PM
Hello,

We have moved the project over to github: https://github.com/Shuttle/shuttle-esb

If you have questions in future it would be great if you could log them there :)

Shuttle can very easily 'front' a web-service call by having an endpoint handle events/commands for the web-service. Say, for example, that you need to register an e-mail address in a third-party newsletter service via a web-service call you NewsLetter endpoint could have a handler for command RegisterNewsLetterUserCommand that contains the e-mail address and maybe some other pertinent information.

That handler would then make the proxy call using the url configured for the endpoint (maybe in the application configuration file). I guess the point is that Shuttle (or any service bus really) would not directly call the web-service. A handler would be responsible for implementing the call. This is the same for sending an e-mail or text message, for instance. An endpoint would have a handler that makes the relevant API / WS calls.

Hope that helps.

Regards,
Eben
Nov 7, 2013 at 1:42 PM
Hi

You can also create a Message which contains the url of the web service, then call "Bus.Send" to send the message to another endpoint. The handler at the target endpoint handles the message by using the contained url to perform the web service call (block call). When the web service replies the handler sends a response back via Bus.Reply.

Regards
Neill