I created a Mule3 Simple Front-end Web Service which is supposed to pass the XML message to a sub-flow and returns success to its caller.
mule-config.xml
I solved this problem by using singleton instance to store requestMessage with in test() method of WebserviceTestImpl class and retrieve it in TestSubflow component. I am not sure if it is perfect. but it works:)
Here is how I did it..
mule-config:
WebserviceTestImpl and TestSubflow code snippet
public class WebserviceTestImpl implements WebserviceTest,Serializable {
private static final long serialVersionUID = 1L;
private TestMessageProxy testMessageProxy;
public TriggerTestImpl() {
this.testMessageProxy = TestMessageProxy.getInstance();
}
@Override
public String test(String requestMessage) throws Exception{
this.testMessageProxy.setTestMessage(requestMessage);
return "success";
}
}
public class TestSubflow implements Callable{
private TestMessageProxy testMessageProxy;
public TestSubflow() {
this.testMessageProxy = TestMessageProxy.getInstance();
}
@Override
public Object onCall(MuleEventContext context) throws Exception {
String testMessage = this.testMessageProxy.getTestMessage();
}
}