Announcement

Collapse
No announcement yet.

Getting rid of xmlns="" in XML message

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

  • Getting rid of xmlns="" in XML message

    Hi All;

    Bit of a perplexing problem.

    I'm getting

    Code:
    <OCANv2FullSubmissionRecord xmlns=""  ...
    In my outbound XML message. It fails on the xmln being present.

    If I strip namespaces I get errors, and have tried it with and without default namespace = '';

    Can anyone tell me how to get rid of this?

    I am contemplating dropping another destination below the one that creates the message and stripping it out using string replace but that seems a bit much.
    I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
    http://www.linkedin.com/pub/david-rothbauer/5/923/518
    codeismydrug.wordpress.com
    hl7coders.wordpress.com

    Test all my code suggestions prior to implementation

  • #2
    Hmm, not sure without looking at the overall channel; can you post it here? Also, do you have a sample (scrubbed) inbound message you can post?
    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
      I'm building it from a database. The source db reader checks one table for new records to transmit.

      The records are in 3rd normal so it queries multiple tables in the destination transformer.

      I can't export the whole channel as there are some destinations with connection info I can't risk spreading but here's the transformer.

      The mapped variables coming in are from a database reader.

      Thanks
      Attached Files
      I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
      http://www.linkedin.com/pub/david-rothbauer/5/923/518
      codeismydrug.wordpress.com
      hl7coders.wordpress.com

      Test all my code suggestions prior to implementation

      Comment


      • #4
        Ah, I think I see what you mean now. So here's sort of how it works. The default E4X namespace is set based on the inbound message, so if your outbound message should use a different namespace, then you have two options. Either reset the default namespace, or declare namespaces as variables and use them with the E4X "::" directive in assignment statements. Here's an example of the former:

        Code:
        default xml namespace = 'http://www.ehealthontario.ca/CCIM';
        Note that in that case since your inbound message doesn't have any namespaces defined, you'll have to use a blank one to extract data:

        Code:
        var ns = new Namespace('');
        logger.info(msg.ns::type.toString());
        Last edited by narupley; 12-21-2012, 06:56 AM.
        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


        • #5
          tried that to no avail.

          I'm thinking of moving the XML message creation to the source transformer and stripping everything out on the way through. Not sure if that will work though.
          I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
          http://www.linkedin.com/pub/david-rothbauer/5/923/518
          codeismydrug.wordpress.com
          hl7coders.wordpress.com

          Test all my code suggestions prior to implementation

          Comment


          • #6
            Originally posted by Bostad View Post
            tried that to no avail.

            I'm thinking of moving the XML message creation to the source transformer and stripping everything out on the way through. Not sure if that will work though.
            What code are you using? I've attached my modified transformer; it works great for me! *shrugs*
            Attached Files
            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


            • #7
              Bit of weirdness, but its working.

              I put it at the top where you had it and suddenly my first sql statement stopped working.

              I put it below the first few lines but higher than I had it initially and it appeared to work!

              Thanks!
              I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
              http://www.linkedin.com/pub/david-rothbauer/5/923/518
              codeismydrug.wordpress.com
              hl7coders.wordpress.com

              Test all my code suggestions prior to implementation

              Comment


              • #8
                hi!
                i try to download the xml but there is an error when load it into mirth.
                This is the error:
                Code:
                Invalid channel file.  : input contained no data
                com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:80)
                com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:137)
                com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:130)
                com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:109)
                com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:94)
                com.thoughtworks.xstream.io.xml.XppReader.<init>(XppReader.java:48)
                com.thoughtworks.xstream.io.xml.XppDriver.createReader(XppDriver.java:44)
                com.thoughtworks.xstream.XStream.fromXML(XStream.java:861)
                com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
                com.mirth.connect.model.converters.ObjectXMLSerializer.fromXML(ObjectXMLSerializer.java:123)
                com.mirth.connect.client.ui.Frame.importChannel(Frame.java:2840)
                com.mirth.connect.client.ui.Frame.doImport(Frame.java:2820)
                sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                java.lang.reflect.Method.invoke(Unknown Source)
                sun.reflect.misc.Trampoline.invoke(Unknown Source)
                sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                java.lang.reflect.Method.invoke(Unknown Source)
                sun.reflect.misc.MethodUtil.invoke(Unknown Source)
                java.beans.EventHandler.invokeInternal(Unknown Source)
                java.beans.EventHandler.access$000(Unknown Source)
                java.beans.EventHandler$1.run(Unknown Source)
                java.security.AccessController.doPrivileged(Native Method)
                java.beans.EventHandler.invoke(Unknown Source)
                $Proxy7.actionPerformed(Unknown Source)
                org.jdesktop.swingx.action.BoundAction.actionPerformed(BoundAction.java:231)
                javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                org.jdesktop.swingx.JXHyperlink.fireActionPerformed(JXHyperlink.java:266)
                javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
                java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
                java.awt.Component.processMouseEvent(Unknown Source)
                javax.swing.JComponent.processMouseEvent(Unknown Source)
                java.awt.Component.processEvent(Unknown Source)
                java.awt.Container.processEvent(Unknown Source)
                java.awt.Component.dispatchEventImpl(Unknown Source)
                java.awt.Container.dispatchEventImpl(Unknown Source)
                java.awt.Component.dispatchEvent(Unknown Source)
                java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
                java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
                java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
                java.awt.Container.dispatchEventImpl(Unknown Source)
                java.awt.Window.dispatchEventImpl(Unknown Source)
                java.awt.Component.dispatchEvent(Unknown Source)
                java.awt.EventQueue.dispatchEventImpl(Unknown Source)
                java.awt.EventQueue.access$000(Unknown Source)
                java.awt.EventQueue$1.run(Unknown Source)
                java.awt.EventQueue$1.run(Unknown Source)
                java.security.AccessController.doPrivileged(Native Method)
                java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                java.awt.EventQueue$2.run(Unknown Source)
                java.awt.EventQueue$2.run(Unknown Source)
                java.security.AccessController.doPrivileged(Native Method)
                java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                java.awt.EventQueue.dispatchEvent(Unknown Source)
                java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                java.awt.EventDispatchThread.run(Unknown Source)
                narupley, can you upload it?
                many thanks!

                Comment

                Working...
                X