ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Need to embed a MRM XML message in a XMLNSC wrapper - RSLVD

Post new topic  Reply to topic
 Need to embed a MRM XML message in a XMLNSC wrapper - RSLVD « View previous topic :: View next topic » 
Author Message
wraymore
PostPosted: Tue Feb 24, 2009 1:03 pm    Post subject: Need to embed a MRM XML message in a XMLNSC wrapper - RSLVD Reply with quote

Centurion

Joined: 16 Aug 2005
Posts: 114
Location: Burlington, NC USA

On WMB 6.0.0.8

We have a TDS formatted message (MRM TDS wire format message set) that is input to the process. The first step is to map some of the fields to XML (MRM XML wire format message set). Then embed the MRM XML within an outer XML that contains meta data about routing (XMLNSC). When I try to put the MRM XML within a CDATA tag, the output message does not show any of the MRM XML however a trace node prior shows it but the MRM tag is NULL. When I try without the CDATA tag, I get an error about specifying a namespace because the XMLNSC portion has Namespaces.

I do not have a namespace declared on the MRM message set.

Here is the mxsd of the MRM XML message set:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
  <xs:element name="message">
        <xs:annotation>
      <xs:appinfo source="WMQI_APPINFO">
        <MRMessage messageDefinition="/0/message;XSDElementDeclaration$MRObject"/>
      </xs:appinfo>
    </xs:annotation>
        <xs:complexType>
            <xs:sequence maxOccurs="1" minOccurs="1">
        <xs:element name="type" type="xs:string"/>
        <xs:element name="patient">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="lab" type="xs:string"/>
              <xs:element name="specno" type="xs:string"/>
              <xs:element name="worksheet" type="xs:string"/>
              <xs:element name="wkshtversion" type="xs:string"/>
              <xs:element name="patlname" type="xs:string"/>
              <xs:element name="patfname" type="xs:string"/>
              <xs:element name="dob" type="xs:string"/>
              <xs:element name="age" type="xs:string"/>
              <xs:element name="gender" type="xs:string"/>
              <xs:element name="physid" type="xs:string"/>
              <xs:element name="sampdate" type="xs:string"/>
              <xs:element name="orders">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element maxOccurs="unbounded" name="order">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="code" type="xs:string"/>
                          <xs:element name="name" type="xs:string"/>
                          <xs:element name="resulttype" type="xs:string"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="results">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element maxOccurs="unbounded" minOccurs="0" name="result">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="code" type="xs:string"/>
                          <xs:element minOccurs="0" name="value" type="xs:string"/>
                          <xs:element minOccurs="0" name="type" type="xs:string"/>
                          <xs:element maxOccurs="unbounded" minOccurs="0" name="abbrevs">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="abbrev" type="xs:string"/>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="comments">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element maxOccurs="unbounded" minOccurs="0" name="comment" type="xs:string"/>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>


Here is my ESQL for CDATA:

Code:
SET OutputRoot.XMLNSC.triadMsgNS:TriadMessage.triadMsgNS:TriadPayload.triadNS:Payload.(XMLNSC.CDataValue) = InputRoot.MRM;


Excerpt from output message body:

Code:
<NS1:TriadPayload><triadcommon:Payload type="XML" format="TEXT" version="1.0"></triadcommon:Payload></NS1:TriadPayload></NS1:TriadMessage>


Excerpt from trace node:

Code:
(0x01000000)http://www.labcorp.com/02/11/2008/V1/TriadMessage.xsd:TriadPayload    = (
        (0x01000000)http://www.labcorp.com/02/11/2008/V1/TriadCommon.xsd:Payload = (
          (0x03000100):type    = 'XML'
          (0x03000100):format  = 'TEXT'
          (0x03000100):version = '1.0'
          (0x02000001):MRM     = NULL
          (
            (0x03000000):type    = 'O'
            (0x01000000):patient = (
              (0x03000000):lab      = 'RN'
              (0x03000000):specno   = '043G4202120'
              (0x03000000):patlname = 'PATIENT'
              (0x03000000):patfname = 'ONE'
              (0x03000000):dob      = '19690515'
              (0x03000000):age      = '0390828'
              (0x03000000):gender   = 'F'
              (0x03000000):sampdate = '200902121111'
              (0x01000000):orders   = (
                (0x01000000):order = (
                  (0x03000000):code       = '980005'
                  (0x03000000):name       = 'Histology Tracking'
                  (0x03000000):resulttype = ' '


Here is my ESQL without the CDATA:

Code:
SET OutputRoot.XMLNSC.triadMsgNS:TriadMessage.triadMsgNS:TriadPayload.triadNS:Payload = InputRoot.MRM;


Get this error:

Code:
BIP5104: Element must have a namespace specified if there is a default namespace in scope


Excerpt from trace node:

Code:
(0x01000000)http://www.labcorp.com/02/11/2008/V1/TriadMessage.xsd:TriadPayload    = (
        (0x01000000)http://www.labcorp.com/02/11/2008/V1/TriadCommon.xsd:Payload = (
          (0x03000000):type    = 'O'
          (0x01000000):patient = (
            (0x03000000):lab      = 'RN'
            (0x03000000):specno   = '043G4202120'
            (0x03000000):patlname = 'PATIENT'
            (0x03000000):patfname = 'ONE'
            (0x03000000):dob      = '19690515'
            (0x03000000):age      = '0390828'
            (0x03000000):gender   = 'F'
            (0x03000000):sampdate = '200902121111'
            (0x01000000):orders   = (
              (0x01000000):order = (
                (0x03000000):code = '980005'
                (0x03000000):name = 'Histology Tracking'
              )


Any will be appreciated!!!!!


Last edited by wraymore on Tue Feb 24, 2009 2:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
chids
PostPosted: Tue Feb 24, 2009 1:15 pm    Post subject: Re: Need to embed a MRM XML message within a XMLNSC wrapper Reply with quote

Novice

Joined: 09 Oct 2006
Posts: 22
Location: Stockholm, Sweden

wraymore wrote:
On WMB 6.0.0.8

We have a TDS formatted message (MRM TDS wire format message set) that is input to the process. The first step is to map some of the fields to XML (MRM XML wire format message set). Then embed the MRM XML within an outer XML that contains meta data about routing (XMLNSC). When I try to put the MRM XML within a CDATA tag, the output message does not show any of the MRM XML however a trace node prior shows it but the MRM tag is NULL. When I try without the CDATA tag, I get an error about specifying a namespace because the XMLNSC portion has Namespaces.



Let me see if I understand what you're trying to do. You have a MRM XML tree which you'd like to serialize (ie produce actual XML) into a specific element within a XMLNSC tree?
_________________
/mårten.
-- http://marten.gustafson.pp.se/
-- marten.gustafson@gmail.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
mqjeff
PostPosted: Tue Feb 24, 2009 1:20 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You might want to look at XMLNSC.AsIsElementContent rather than PCDataSection.

Or base64 encoding.
Back to top
View user's profile Send private message
wraymore
PostPosted: Tue Feb 24, 2009 1:23 pm    Post subject: Reply with quote

Centurion

Joined: 16 Aug 2005
Posts: 114
Location: Burlington, NC USA

That is correct.
Back to top
View user's profile Send private message
wraymore
PostPosted: Tue Feb 24, 2009 1:59 pm    Post subject: Reply with quote

Centurion

Joined: 16 Aug 2005
Posts: 114
Location: Burlington, NC USA

Thanks chids for the pointer of serialize. I found this link through DeveloperWorks: http://www-01.ibm.com/support/docview.wss?uid=swg21214413 (Embedding part of an XML message in an output XML CDATA section). I have resolved my issue.

mqJeff, thanks for your reply also, I will try your suggestions and see which management prefers.

Back to top
View user's profile Send private message
chids
PostPosted: Tue Feb 24, 2009 2:17 pm    Post subject: Reply with quote

Novice

Joined: 09 Oct 2006
Posts: 22
Location: Stockholm, Sweden

wraymore wrote:
Thanks chids for the pointer of serialize. I found this link through DeveloperWorks: http://www-01.ibm.com/support/docview.wss?uid=swg21214413 (Embedding part of an XML message in an output XML CDATA section). I have resolved my issue.


Glad to have helped, you're more to than welcome to explain how you solved it. Did you do it with ESQL and the ASBITSTREAM function?

Also, I was about to ask you why you didn't simply map your MRM TDS directly to a XMLNSC tree - assuming there's a smooth way to do that with your scenario.
_________________
/mårten.
-- http://marten.gustafson.pp.se/
-- marten.gustafson@gmail.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
fjb_saper
PostPosted: Wed Feb 25, 2009 3:46 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

chids wrote:

Also, I was about to ask you why you didn't simply map your MRM TDS directly to a XMLNSC tree - assuming there's a smooth way to do that with your scenario.

As his original post said he had tried that part but hit the "namespace not set with a default namespace in scope" legitimate problem and probably did not want to set the default namespace throughout the MRM tree.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
chids
PostPosted: Wed Feb 25, 2009 10:59 am    Post subject: Reply with quote

Novice

Joined: 09 Oct 2006
Posts: 22
Location: Stockholm, Sweden

fjb_saper wrote:
chids wrote:

Also, I was about to ask you why you didn't simply map your MRM TDS directly to a XMLNSC tree - assuming there's a smooth way to do that with your scenario.

As his original post said he had tried that part but hit the "namespace not set with a default namespace in scope" legitimate problem and probably did not want to set the default namespace throughout the MRM tree.


I was way past my bedtime yesterday. You're absolutely right, and the link also stated how it was solved. Sorry about not reading (or thinking) properly.
_________________
/mårten.
-- http://marten.gustafson.pp.se/
-- marten.gustafson@gmail.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
wraymore
PostPosted: Fri Feb 27, 2009 5:39 am    Post subject: Reply with quote

Centurion

Joined: 16 Aug 2005
Posts: 114
Location: Burlington, NC USA

Here is my code that resolved my issue:

Code:
DECLARE OrderBlob BLOB ASBITSTREAM(InputRoot.MRM,
            InputRoot.MQMD.Encoding,
            InputRoot.MQMD.CodedCharSetId,
            InputRoot.Properties.MessageSet,
            InputRoot.Properties.MessageType,
            InputRoot.Properties.MessageFormat,
            FolderBitStream);
      DECLARE OrderChar CHAR CAST(OrderBlob AS CHAR CCSID InputRoot.MQMD.CodedCharSetId);      
            
      SET OutputRoot.XMLNSC.triadMsgNS:TriadMessage.triadMsgNS:TriadPayload.triadNS:Payload.(XMLNSC.CDataValue) = OrderChar;


Many Thanks!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Need to embed a MRM XML message in a XMLNSC wrapper - RSLVD
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.