Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Destination after javascript writer (http://www.mirthcorp.com/community/forums/showthread.php?t=219124)

ruben_synlab 05-03-2019 03:03 AM

Destination after javascript writer
Good morning all,
I have a channel which has a javascript writer as a first destination and it builds a message that I want to sent to the next destination

the javascript code ends in:

return new Response(SENT,msg.getMessage());

But in the next destination I'm not able to get the message, I only get "true". Cheking it in the dashboard, the message is in the first destination response but the raw data in the second destination is "true".

Could anyone help me out?

Thank you!

cory_cole 05-03-2019 06:34 AM

Because you have this...

return new Response(SENT,msg.getMessage());

You are returning the result of Response(SENT,msg.getMessage()), which is true.

You need to return the msg.

agermano 05-05-2019 10:45 AM

Your raw content for all of your destinations is always the output from the source transformer. You should be able to retrieve your response for destination 1 from the responseMap (it should show up in the drag and drop area of your second destination.) It's the full Response that is stored there, so you'll have to so something like $('d1').getMessage().

claudio12 05-30-2019 10:04 AM

Question about answer in JSONResponse
Good morning Narupley, I am writing you for a consultation. I have a channel with a source (Http Listener) to catch some parameters that are sent by url and then they are sent in the Destination (Webservice Sender) and I get an answer back:

<s: Envelope xmlns: SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: s = "http://schemas.xmlsoap.org/soap/envelope/">
****<SOAP-ENV: Header />
****<s: Body>
********<QryLstResponse xmlns = "http://tempuri.org/">
************<QryLstResult xmlns: a = "http://schemas.datacontract.org/2004/07/AXQrWService" xmlns: i = "http://www.w3.org/2001/XMLSchema-instance">
****************<a: AXQrResult>
********************<a: docID> 134-3 </ a: docID>
********************<a: fields>
************************<a: AXField>
****************************<a: AXFieldID> 0 </ a: AXFieldID>
****************************<a: AXFieldName> MEMBER NUMBER </ a: AXFieldName>
****************************<a: AXFieldValue> 9211111 </ a: AXFieldValue>
************************</ a: AXField>
************************<a: AXField>
****************************<a: AXFieldID> 0 </ a: AXFieldID>
****************************<a: AXFieldName> CHECK </ a: AXFieldName>
****************************<a: AXFieldValue> 114 </ a: AXFieldValue>
************************</ a: AXField>
********************</ a: fields>
********************<a: numpages> 2 </ a: numpages>
****************</ a: AXQrResult>
************</ QryLstResult>
********</ QryLstResponse>
****</ s: Body>
</ s: Envelope>

I need to convert this response to JSON and return it to the URL to the application that invokes the URL.

All times are GMT -8. The time now is 01:15 AM.

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