I am using 3.0.3.7171 on Windows
I have a requirement to make a call out to an external web service - get the results (SOAP Message) parse and extract some data which is then inserted into an out bound message
I have attached a channel export - I have also attached a sampl of the Web Service response
The call out to the web service works and I get the response back and place it in Global Channel Map called WS_Response
The problem arises when I try to parse the response - Destination 1 Transfomer
I am trying
var WS_ResponseXML = new XML(WS_Response);
var dummy = WS_ResponseXML['soap:Body']['ns1:getAllEncountersForPatientResponse']['encounter'][0]['@encounter_number'].toString()
The error I get is
42: var WS_ResponseXML = new XML(WS_Response);
43: var dummy = WS_ResponseXML['soap:Body']['ns1:getAllEncountersForPatientResponse']['encounter'][0]['@encounter_number'].toString()
44:
45: logger.info('Encounter Number = ' + dummy)
46: if ('xml' === typeof msg && msg.hasSimpleContent()) { msg = msg.toXMLString(); }if ('xml' === typeof tmp && tmp.hasSimpleContent()) { tmp = tmp.toXMLString(); }
47: }
LINE NUMBER: 43
DETAILS: TypeError: Cannot read property "@encounter_number" from undefined
Can any explain how I can parse the WS_Response
Thanks
I have a requirement to make a call out to an external web service - get the results (SOAP Message) parse and extract some data which is then inserted into an out bound message
I have attached a channel export - I have also attached a sampl of the Web Service response
The call out to the web service works and I get the response back and place it in Global Channel Map called WS_Response
The problem arises when I try to parse the response - Destination 1 Transfomer
I am trying
var WS_ResponseXML = new XML(WS_Response);
var dummy = WS_ResponseXML['soap:Body']['ns1:getAllEncountersForPatientResponse']['encounter'][0]['@encounter_number'].toString()
The error I get is
42: var WS_ResponseXML = new XML(WS_Response);
43: var dummy = WS_ResponseXML['soap:Body']['ns1:getAllEncountersForPatientResponse']['encounter'][0]['@encounter_number'].toString()
44:
45: logger.info('Encounter Number = ' + dummy)
46: if ('xml' === typeof msg && msg.hasSimpleContent()) { msg = msg.toXMLString(); }if ('xml' === typeof tmp && tmp.hasSimpleContent()) { tmp = tmp.toXMLString(); }
47: }
LINE NUMBER: 43
DETAILS: TypeError: Cannot read property "@encounter_number" from undefined
Can any explain how I can parse the WS_Response
Thanks
Parse SOAP Message in Javascript
0 commentaires:
Enregistrer un commentaire