Announcement

Collapse
No announcement yet.

XML data to variable always empty

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • XML data to variable always empty

    Dear Community,

    I'm stuck with this, I will appreciate any help.

    I have a Webservice sender that does a Patient Query, the response is a RSP_K21 embedded in an XML with its SOAP envelope.

    Something like this:

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
    <ConsultaPacientesResponse xmlns="http://tempuri.org">
    <ConsultaPacientesResult>
    &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;RSP_K21 xmlns="urn:hl7-org:v2xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    &gt;&lt;MSH&gt;&lt;MSH.1&gt;|&lt;
    /MSH.1&gt;&lt;MSH.2&gt;^~\&amp;amp;&lt;
    /MSH.2&gt;&lt;MSH.3&gt;&lt;HD.1&gt;LIS&lt;
    /HD.1&gt;&lt;/MSH.3&gt;&
    
    ...And so on
    To make it readable, I do this in the response transformer:

    var respuesta = msg..*::ConsultaPacientesResult;
    logger.debug(respuesta);

    And "respuesta" looks like this:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <RSP_K21 xmlns="urn:hl7-org:v2xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    	<MSH>
    		<MSH.1>|</MSH.1>
    		<MSH.2>^~\&amp;</MSH.2>
    		<MSH.3>
    			<HD.1>LIS</HD.1>
    		</MSH.3>
    		<MSH.4>
    			<HD.1>LAB</HD.1>
    		</MSH.4>
    ... And so on.
    I need to store in a channel variable some of the fields of this XML. But always, no matter what I do, it always contains an empty string. I tried diffent notations but no way... I cannot access data within this tags.

    I think this is a common issue within begginers but i'm not able to find the solution anywhere.

    THANKS!!!

    BTW, I'm using MIRTH 3.2.2.7694
Working...
X