“I have a web service that I need to connect to in this process, try how do I do it using the ESB?”
We at Stott Creations spent probably the most time on this topic.
Our first inclination was to use a request response off-ramp.
We quickly discovered that the whole off-ramp was designed with the (misguided) understanding that the web service you were connecting to was going to pass back all of the data you needed along the bus.
I have never seen this to be the case. An shipping verification hosted by UPS does not have the capability to handle the data flowing on the ESB, vialis 40mg nor do I really want that data going out to a third party web service.
We have a standardized way of calling request-response end points, even one-way endpoints.
I drop a Itinerary Service onto the Itinerary Surface and name it Call External WS
Set the Service Name to StottCreations.ESB.Orchestration.Send
I set the following:
Tracking Enabled: True – I want to see the status of this step in the Portal
Storage: True – I want to see the the entire payload stored in the BAM Activity
Reprocessing Behavior: Stop – If an exception happens, what should I do?
- Stop: Stop processing and wait for resubmission to continue
- Continue: Mark it as an error, but don’t stop processing, continue on (another blog post will explain further)
- Reset: The standard approach for the ESB Toolkit: if an exception happens, start the itinerary from the beginning when the issue that caused it to fail is fixed
There are two to three resolvers that need to be added.
- Map to create the request message
- End point settings
- (optional) Merge map that takes the response and merges it back to the message flowing on the bus
So let’s create a resolver called Make Request, use the static resolver, and choose InternalInterface.CanonicalToExternalWS
Now lets add a new resolver for defining the end point.
I follow the same steps to define the endpoint as documented in the ESB Hints post
The next (optional) step is to create a merge map.
Essentially, I am going to take the response from the web service and merge it into the original message that was on the bus.
I create a temp orchestration and define my two messages:
I create a transform shape and define it to take the OriginalMsg and the ResponseMsg creating the OriginalMsg
I open the map and create the mapping:
Delete the orchestration, and deploy the map.
Now point to the map in the last resolver (called Merge Response)