web stats
How to transform response messages?? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-27-2009, 08:06 AM
ignaciofedz ignaciofedz is offline
Mirth Newb
 
Join Date: Apr 2009
Posts: 14
ignaciofedz is on a distinguished road
Default How to transform response messages??

I have this scenario:

HTML Code:
----------                      ------------                    ----------
|             |   --XML--->  |                | --HL7-->     |             |
|  App 1   |                   |   MIRTH    |                  |  App   2  |
|             |   <--XML---  |                | <--HL7--     |             |
 ---------                      -----------                      ----------

I'm new baby in Mirth and I've been doing so many tests with no result :-(, the problem is this:
1- App 1 opens a connection to an HTTP Listener in Mirth.
2- Mirth translates the message and it opens a new connection to App 2.
3- A response message is received from App 2 (synchronous connection).
4- I want to transform the App 2 response message in Mirth, but I couldn't get anyway to transform it generating an XML response which should be sent back to App 1 (using the same initial connection established by App1).

How can I apply transformations over the App 2 response message?

Could I use several channels?, should it be done in a unique channel?

Best redards!

Last edited by ignaciofedz; 04-30-2009 at 12:28 AM.
Reply With Quote
  #2  
Old 04-30-2009, 12:27 AM
ignaciofedz ignaciofedz is offline
Mirth Newb
 
Join Date: Apr 2009
Posts: 14
ignaciofedz is on a distinguished road
Default

Could I capture the response message from other channel when you send a message to it using a channel writer??

Best regards,

Ignacio.
Reply With Quote
  #3  
Old 04-30-2009, 08:45 AM
dans dans is offline
Mirth Employee
 
Join Date: Apr 2007
Location: Irvine, CA
Posts: 590
dans is an unknown quantity at this point
Default

You can transform the response in the post processor in Mirth. You can do something like the following:
// this is how to get the response
var response = responseMap.get("DestinationName").getMessage();
// this is how to set a custom response
var myResponse = "This is my response";
responseMap.put("DestinationName", ResponseFactory.getSuccessResponse(myResponse));
Reply With Quote
  #4  
Old 05-03-2009, 11:51 PM
jgarcia jgarcia is offline
Mirth Newb
 
Join Date: Apr 2009
Posts: 11
jgarcia is on a distinguished road
Default

That is the way I can get a response message, but how can I transform it or process it in any other destination as incoming message?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation