web stats
Issue CDATA encoding - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2018, 09:37 AM
L33R L33R is offline
What's HL7?
 
Join Date: Apr 2018
Posts: 2
L33R is on a distinguished road
Default Issue CDATA encoding

Hi,

I have a webservice listener and I'm using the default wsdl. I'm having problems with the encoding of CDATA. How do I change the the &lt to < etc.. so I can map the message ?

I have tried :
Code:
message = message.replace(/&lt;/g,'<');
message = message.replace(/&gt;/g,'>');

return message;
in the preprocessor but it doesn't work.


Message:
Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://ws.connectors.connect.mirth.com/">
    <soapenv:Body>
        <acceptMessage>         <arg0>&lt;TestNumber&gt;&lt;Number&gt;1237567235&lt;/Number&gt;&lt;/TestNumber&gt;</arg0>
        </acceptMessage>
    </soapenv:Body>
</soapenv:Envelope>

Last edited by L33R; 08-08-2018 at 04:44 AM.
Reply With Quote
  #2  
Old 08-08-2018, 04:05 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 530
agermano is on a distinguished road
Default

You are receiving XML embedded in XML, so the inner XML is encoded.

In your transformer:
Code:
var testNumber = new XML(msg.toString());
logger.info(testNumber.Number);
Reply With Quote
Reply

Tags
cdata, encoding

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 04:46 AM.


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