Announcement

Collapse
No announcement yet.

Strip Namespaces?

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

  • Strip Namespaces?

    Hey all.
    I have a channel which transforms an HL7 to XML, which is then send via SOAP to a WebService.
    Sending an XML to the WebService works, I got also responses. But the WebService is very specific in the layout of the XML.

    This has to be my final XML:
    Code:
    <ADT xmlns="http://tempuri.org/ADT_HL7_ManageADTA01.xsd">
      <cSite>WS_LOCATION1CODE_IN</cSite>
      <cRecord_number>1111</cRecord_number>
      <cLast_name>Last Name</cLast_name>
      <cFirst_name>First Name</cFirst_name>
    </ADT>
    Problem is that with the default strip namespaces on, the xmlns="http://tempuri.org/ADT_HL7_ManageADTA01.xsd" is stripped and the WebService rejects then my message.
    So when I deactived the strip namespaces my XML to the WebService is accepted nicely, only problem is it doesn't get parsed now .

    I also tried with adding
    Code:
    default xml namespace = 'http://tempuri.org/ADT_HL7_ManageADTA01.xsd';
    after disabling Strip Namespaces. But no luck ...

    Attached my Channel. Could someone point me in the good direction?
    Attached Files
    Last edited by discofris; 01-09-2014, 01:47 AM.
    Mirth Connect Server 3.4.1.8057
    Java version: 1.8.0_101

    on Debian 8.5 and various Winboxes

  • #2
    Do this instead:

    Code:
    var ns = new Namespace('http://tempuri.org/ADT_HL7_ManageADTA01.xsd');
    tmp.addNamespace(ns);
    Then in your message builder, use this for the Message Segment:

    Code:
    tmp.ns::['cRecord_number']
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      Waw 'narupley' ... I'm speechless
      Worked like a charmed ... looking forward to my next bump on the road.

      Many thanks for your prompt help!!
      Mirth Connect Server 3.4.1.8057
      Java version: 1.8.0_101

      on Debian 8.5 and various Winboxes

      Comment


      • #4
        Thread bump ... sorry ...

        I tried the above for an XML where the text nodes are one node deeper.
        My final XML should look like this:

        Code:
        <ADT xmlns="http://tempuri.org/ADT_HL7_ManageADTA01.xsd">
        <SiteDetails>
          <cSite>WS_LOCATION1CODE_IN</cSite>
        </SiteDetails>
        <PatientDetails>
          <cRecord_number>1111</cRecord_number>
          <cLast_name>Last Name</cLast_name>
          <cFirst_name>First Name</cFirst_name>
        </PatientDetails>
        </ADT>
        But I can't seem to figure out how to do this, works great with all textnodes in the root node, but not with the textnodes in separate nodes ... any help appreciated ... thanks!
        Mirth Connect Server 3.4.1.8057
        Java version: 1.8.0_101

        on Debian 8.5 and various Winboxes

        Comment


        • #5
          It's the same process, just make sure you also tack on the namespace for all the children you go into...something like...

          Code:
          tmp.ns::['PatientDetails'].ns::['cRecord_number']
          Mirth Connect v3.2.2
          Java 8
          SQL Server 2005

          Comment


          • #6
            Got it. Thanks!
            Mirth Connect Server 3.4.1.8057
            Java version: 1.8.0_101

            on Debian 8.5 and various Winboxes

            Comment

            Working...
            X