Mirth seemingly not converting reponses to JSON #4578
-
Mirth Version : 3.5.1 So I have this listener channel that receives HL7 messages, transforms each one in JSON, sends each one to an app, the app responts with a JSON and then the response transfer runs like two lines of javascript in case of an error. I'm having trouble finding out why Mirth for some reason fails to parse the response. Instead of getting just the JSON I'm getting this with Status: SENT and the response transformer fails because I haven't used try
Why does this happen ? Should I just set it to RAW ? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
All it means is that the interpreter is expecting JavaScript or JSON and you are feeding it HTML/XML. Check the src path to your JavaScript to make sure it is correct and that the syntax is also correct, including not misplacing any semicolons involved. We would also need to see this script to see what you are trying to accomplish. |
Beta Was this translation helpful? Give feedback.
-
Perhaps post your channel export. |
Beta Was this translation helpful? Give feedback.
-
From the channel you posted to pasetbin in #4578 (reply in thread), in your @rjkroll was correct that the error was indicating the channel was getting XML when it was expecting JSON. You could have set it to Raw like you proposed in the question to avoid the exception, but the setting on the destination would still have caused it to come in as XML. |
Beta Was this translation helpful? Give feedback.
-
Thank you all. |
Beta Was this translation helpful? Give feedback.
From the channel you posted to pasetbin in #4578 (reply in thread), in your
NewInvitation_ORM_NW
destination, you have Response Content set to XML Body, which is creating the XML you are seeing in your response transformer. I had suggested you check that setting #4578 (reply in thread). YourCancelInvitation_ORM_CA
HTTP Sender is not set that way, so I assume it is not having the same issue.@rjkroll was correct that the error was indicating the channel was getting XML when it was expecting JSON. You could have set it to Raw like you proposed in the question to avoid the exception, but the setting on the destination would still have caused it to come in as XML.