Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

XPath wildcards on Mirth. Is it possible?

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

  • XPath wildcards on Mirth. Is it possible?

    Hello all:

    I have a channel that receives xml documents. It is invoked for evaluating all SOAP responses from the web service I invoke in another channel. The problem is that the response XML format depends on the WS method I invoke.

    If I call to the WS method "mergePatients()", the response has this shape:
    Code:
    <soapenv:Body>
      <ns:mergePatientsResponse xmlns:ns="[url]http://pojo">[/url]
         <ns:return type="pojo.RespuestaWS" xmlns:ax21="[url]http://pojo/xsd">[/url]
              <ax21:messageId>00000003</ax21:messageId>
              <ax21:«»success>true</ax21:«»success>
         </ns:return>
      </ns:mergePatientsResponse >
    </soapenv:Body>
    If I call to the WS method "updatePatient()", the response has this shape:
    Code:
    <soapenv:Body>
      <ns:updatePatientResponse xmlns:ns="[url]http://pojo">[/url]
         <ns:return type="pojo.RespuestaWS" xmlns:ax21="[url]http://pojo/xsd">[/url]
              <ax21:messageId>00000004</ax21:messageId>
              <ax21:«»success>true</ax21:«»success>
         </ns:return>
      </ns:updatePatientResponse>
    </soapenv:Body>
    As you can see, the responses only differs in one "intermedium" node. I've tried to access to the messageId element in this way:

    Code:
    msg['soapenv:Body']['ns:*Response']['ns:return']['ax21:messageId'].toString()
    But it raises an error. How can I do it?

    Thanks in advance ;-)

    Carlos.

    Post edited by: krlosnow, at: 10/22/2008 08:27

  • #2
    Re:XPath wildcards on Mirth. Is it possible?

    The real problem aren't the wildcards (I've noticed after posting the prior post). The problem is the SOAP envelope namespace. I've post it in:


    http://www.mirthproject.org/index.ph...5&id=7617#7617

    Best regards ;-)

    Carlos.

    Comment


    • #3
      Re:XPath wildcards on Mirth. Is it possible?

      Hello again:


      I've solved the wildcard problem using a javascript step instead of a mapping step:

      Code:
      var messageId = msg..messageId[0].toString();
      var success = msg..success[0].toString();
      channelMap.put('messageId',messageId);
      channelMap.put('success',success);
      return true;
      I've tested it successfully in another channel with another XML document template (without soapenv namespace).

      Comment


      • #4
        Re:XPath wildcards on Mirth. Is it possible?

        Hello all:

        I've found a workaround for the namespace problem. I've posted it on the referred link:

        http://www.mirthproject.org/index.ph...3&catid=5#7633

        Post edited by: krlosnow, at: 10/23/2008 05:19

        Comment

        Working...
        X