简体   繁体   中英

How to Parse XML Response getting from WebService in Mirth Connect 3.0

I have one destination of type Web Service Sender. That web service sends XML Response. I want to read values from that response & write in to the database. How can I read XML Response & retrieve values from response XML.

I tried in 'Edit Response' option from channel Tasks by putting XML template & creating variables from xml tree.But it didn't work.

How could I read & parse xml response ?

Are you sure that you are getting response back from the Web Service Sender?? Response from the destination must be in Edit Response 'msg' variable, if the response is empty none of the steps in Edit Response gets executed. To check if you are really getting response from destination put a logger statement in Edit Response, to check if the control is going in Edit Response.

The Response from Webservice Sender , can be got from the responseMap in Mirth. The following code can help.

var destination = responseMap.get("Destination Name");
var responseMessage = destination.getMessage();

You can get the responseMessage and add it to the Channel Map so that the rest of the destinations in the channels can also access it.

Let us know how it goes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM