Announcement

Collapse

NextGen (Mirth) Connect 3.10.0 Released!

NextGen (Mirth) Connect 3.10.0 is now available as an appliance update and on our GitHub page. This release includes better SQL Server database support, security improvements through fixes and library updates, and improvements for the Advanced Clustering plugin with a focus on improving performance of many of the tasks that are carried out on a frequent interval. 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

Simple SOAP sender throws SAXParseException

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

  • Simple SOAP sender throws SAXParseException

    I have a very simple chanel, with a file reader and a SOAP sender, but when I try to send the following simple message:

    MSH|^~\\&|HCE||LIS||20061117092345||QRY^R02|41581| P|2.5
    QRD|20061117092345|R|I|41581|||1^RD|ORD|105238
    QRF||20061116000000|20061116235959

    I get the following exception:

    org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.

    If I replace then '&' sympol by '#' in the MSH segment, then the message is sent without problems.

    Do I need to set any transformer for this simple situation? How can I avoid this exeption?

    Thanks!

  • #2
    Re:Simple SOAP sender throws SAXParseException

    Can you post your channel? Thanks!
    Chris Lang

    Comment


    • #3
      Re:Simple SOAP sender throws SAXParseException

      This is because the MSH semegment in non-compliant HL7 er7 syntax

      MSH|^~&|
      is a wrong secuence of encoding characters It should be:

      MSH|^~\\&|

      (The escape character (\\) should be defined previous to the sub-filed separator (&)

      This can be solved using the preprocessor script, with a replace JS function. Search in the forum, there are a lot of post about how to use it.

      Comment


      • #4
        Re:Simple SOAP sender throws SAXParseException

        Alberto -

        I believe the MSH segment is correct, however the forum is stripping out the slash. When posting HL7 or code, wrap the text in the [ code ] tags.

        Pablo Leon -

        You are getting your entity error because the SOAP sender is trying to send the raw HL7 - however it needs to send valid XML. Since the & character can not be used by itself in valid XML, you need to either replace amperstands with
        Code:
        &
        or (the best solution)you need to set your SOAP sender to wrap the message data with an entity encoder.

        When you drag your message variable to the SOAP sender, also drag "entity encoder". Your soap value should look something like:

        Code:
        encoder.encode(messageObject.rawData)
        The encoder will convert XML characters to the proper entities. You can use encoder.decode to convert entities back to the normal characters. The encoder can be used anywhere in your Javascript, as well on any file, llp, tcp, soap, etc template on the destination tab.

        Hope this helps!
        Chris Lang

        Comment


        • #5
          Re:Simple SOAP sender throws SAXParseException

          Thanks Chrisl, now I have the channel running almost smooth. :laugh:

          But, some of our messages have international characters (in Spain, we have a few Ñ). When this messages are processed, we obtain the following exception:

          org.xml.sax.SAXParseException: The entity "Ntilde" was referenced, but not declared.

          Comment


          • #6
            Re:Simple SOAP sender throws SAXParseException

            The 1.5.1 release of Mirth will give you the ability to turn automatic entity encoding off.
            Chris Lang

            Comment


            • #7
              Re:Simple SOAP sender throws SAXParseException

              Chirsl, I have seen you have posted a 1.5 patch1, and I have tried it, but the problem still persists. When is the 1.5.1 release scheduled?

              Comment

              Working...
              X