Hi Javier, The synapseEnvironment.injectMessage(mc) is a asynchronous call, which will return once you call that method, and another thread will mediate the message and invoke the actual ws.
The response will be received by the main sequence, so what you could do is to write a custom mediator, to act as a callback an place that on the main sequence for out path, which will callback to the task with the response. <sequence name="main"> <in> <send/> </in> <out> <class name="your-custom-class-name-which-acts-as-a-callback-to-the-task"/> </out> </sequence> Thanks, Ruwan Javier López del Castillo Caymares wrote: > Hello: > > A have a task where I inject a message to synapse environment, the > message is a web service call, I need to get the response. Could any > body tell me what to do? > > here is the code: > > ... > > MessageContext mc = synapseEnvironment.createMessageContext(); > mc.setTo(new EndpointReference(this.do)); > mc.setSoapAction(this.soapAction); > synapseEnvoronment.injectMessage(mc); > > ... > > > it works, the service is invoked, but I don't know how to get the > result. > > thx and best regards. > > jlcc > > > > _______________________________________________ > Esb-java-user mailing list > [email protected] > https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user > > -- Ruwan Linton Software Architect & Product Manager, WSO2 ESB; http://wso2.org/esb WSO2 Inc.; http://wso2.com Lean . Enterprise . Middleware phone: +1 408 754 7388 ext 51789 email: [email protected]; cell: +94 77 341 3097 blog: http://blog.ruwan.org linkedin: http://www.linkedin.com/in/ruwanlinton tweet: http://twitter.com/ruwanlinton _______________________________________________ Esb-java-user mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
