0
votes

In my application, a client sends a SOAP request through a JSP page to the Mule ESB and ESB routes it to a Weather Service. I want to send the response from the service to the client through ESB: how can I structure the flow to achieve this? Where will the response land in Mule ESB in first place?

<Flow>
Step1:inbound endpoint>
Step 2:<component>
Step 3:<outbound endpoint>
Step4:<component>
Step 5:<outbound endpoint>
<Flow>

Is this flow correct? Is this enough to pass the reponse to the client?

I have some questions on this:

  1. From the outbound endpoint: can I send the response directly to the client without routing to the component?
  2. Do I need to call the same component class again to pass the response?

Code snippets or samples regarding this will be a great help.

Please give your suggestions.

3

3 Answers

0
votes

Assuming all your endpoints are request-response, the message that will reach the end of your flow will be used as a response to the inbound endpoint.

In the response phase, Mule doesn't go through the flow elements it went through in the request phase. You could actually add components/transformers to execute only in the response phase by wrapping them in a <response> element.

So the answers are:

  1. Yes.
  2. No.
0
votes

For transforming the response u got from the service to whatever response as expected by the user. you should use outbound transformers to do so

probably you can take a look at transformers in mule. http://www.mulesoft.org/documentation/display/MULE2USER/Using+Transformers

0
votes

https://developer.mulesoft.com/docs/display/current/Using+Perceptive+Flow+Design

https://developer.mulesoft.com/docs/display/current/Flows+and+Subflows Mule applications are built around one or more flows. Typically, a Mule application begins processing a message it is received by an inbound endpoint in a flow. This flow can then either implement all processing stages, or route the message to other flows or subflows to perform specific tasks. Relative to the flow which triggered its execution, a flows and subflows can process messages either synchronously (see below, top) or asynchronously