web stats
Destination after javascript writer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-03-2019, 04:03 AM
ruben_synlab ruben_synlab is offline
What's HL7?
 
Join Date: Jan 2019
Posts: 1
ruben_synlab is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 05-03-2019, 07:34 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,310
cory_cole is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 05-05-2019, 11:45 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,028
agermano is on a distinguished road
Default

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().
Reply With Quote
  #4  
Old 05-30-2019, 11:04 AM
claudio12 claudio12 is offline
What's HL7?
 
Join Date: Feb 2018
Posts: 3
claudio12 is on a distinguished road
Default 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.
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 11:29 PM.


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