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

LLP To SOAP

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

  • LLP To SOAP

    Hi,
    I am using Mirth Version 1.7.1.3422. What i am trying to do is:
    1> To get an Xml message through LLP port
    2> Send this xml (without doing any transformation or anything) through SOAP connector type to a web service method which accepts this xml as a string parameter.

    Sample message which i am trying to send is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <HL7Message>
    <MSH>
    <MSH.1>|</MSH.1>
    </MSH>
    <PID>
    <PID.1>
    <PID.1.1>1</PID.1.1>
    </PID.1>
    </PID>
    </HL7Message>

    But I am getting the error message as follows:

    ERROR MESSAGE:

    FAILURE: Error invoking WebService
    AxisFault
    ; nested exception is:

    org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.


    I am attaching the channel named as LLPToSOAP.xml.

    The following is a sample SOAP 1.1 request and response

    POST /SampleMirthWebService/Service1.asmx HTTP/1.1
    Host: localhost
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://tempuri.org/GetXmlFromMirth"

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <GetXmlFromMirth xmlns="http://tempuri.org/">
    <strXML>string</strXML>
    </GetXmlFromMirth>
    </soap:Body>
    </soap:Envelope>

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <GetXmlFromMirthResponse xmlns="http://tempuri.org/">
    <GetXmlFromMirthResult>boolean</GetXmlFromMirthResult>
    </GetXmlFromMirthResponse>
    </soap:Body>
    </soap:Envelope>

    Thanks LLPToSOAP.xml (9519 bytes)

    Post edited by: varun, at: 09/15/2008 02:36

  • #2
    Re:LLP To SOAP

    The problem is that when you just stuff the message XML into the SOAP message, the SOAP XML tries to reread all of the XML header info from the contents as well as the SOAP envelope.

    I think you can use CDATA in SOAP. I am not sure.

    Try using something like this in your mapping to find out:
    Code:
    var mystring = '<![CDATA[' + my_xml_from_mirth + ']]>';
    Also, please use CODE tags when posting XML, error messages, or javascript.
    Jon Bartels

    Zen is hiring!!!!
    http://consultzen.com/careers/
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.

    Comment


    • #3
      Re:LLP To SOAP

      hi jbartels!
      Thanks for looking into the problem.
      I have got the solution for the above problem.Actually i was trying to send the Xml data over HTTP without encoding it. So i used the entity encoder.

      Code:
      ${encoder.encode(${message.rawData})}
      Basically you can also use:
      Code:
      ${encoder.encode(${message.transformedData})}
       ${encoder.encode(${message.transformedData})}
      So it depends on ${encoder.encode()} function. We can also use javascript to encode and decode and use it over here.

      SOAP Envelope:

      <?xml version="1.0" encoding="utf-16"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
      <GetXmlFromMirth xmlns="http://tempuri.org/">
      <strXML>${encoder.encode(${message.rawData})}</strXML>
      </GetXmlFromMirth>
      </soap:Body>
      </soap:Envelope>

      Comment


      • #4
        Was running into exactly the same problem, and the CDATA trick worked nicely.

        Comment

        Working...
        X