Invalid XML character in error message

lundi 29 septembre 2014

Hi guys,



I've been searching through the forums and I've tried to remove the special characters in my preprocessor but I'm still getting the following error in my transformer:



"TypeError: Character reference "&#11" is an invalid XML character"



Essentially what I'm trying to do is wrapping an HL7 into a XML to call a web service on my web server.



Pre-processor code:



// Modify the message variable below to pre process data

message = message.replace(/[\x00-\x08]|[\x0B-\x0C]|[\x0E-\x1F]/g, '');

message = trim(message);



function trim(str) {

return str.replace(/^\s+/, '').replace(/\s+$/, '')

}



return message;



Transformer code:



var ppRequest = <Request/>;



ppRequest['UserID'] = 'LABINTERFACE@CDE';

ppRequest['Password'] = 'p235sfa43T';

ppRequest['Method'] = 'mapAddLabReport';



ppRequest['Params'] = <Params><LabResult/></Params>;

ppRequest['Params']['LabResult'] = createLab();



tmp = new XML(ppRequest.toString()); //This is where the error occurs

return true;





function createLab() {

var lab = <LabResult/>;



lab['hl7Message'] = messageObject.getRawData().toString();

lab['status'] = new String('0');



return lab;

}





My mirth version:



Mirth Connect Server 3.0.3.7171

Built on May 20, 2014

Server ID: 8db90333-2583-4627-b5b5-385e8869ac6f

Java version: 1.7.0_65



I'm on Mac OS X by the way.



Any help would be greatly appreciated!





Invalid XML character in error message

0 commentaires:

Enregistrer un commentaire