I have implemented a web service client, which takes XML as an input and returns XML output.
I am converting that XML into fix length format to pass it to mainframe system and mainframe system will return fix length string.
I am calling mainframe system using JMS and using CorrelationID for identifying response.
I am using receive() method with correlation id as message selector and timeout of 5 seconds to get response from mainframe systems.
However the one who reviewed my code said. "Instead of using receive() method use Listener."
Now i am not able to understand how can i use Listener which works asynchronously with the web service which works synchronously.
Web service need to send response within few seconds.
How can i bind Listener's onMessage(Object object) with web service response ?