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 » Broker 6.1: XSD and mapping

Post new topic  Reply to topic Goto page Previous  1, 2
 Broker 6.1: XSD and mapping « View previous topic :: View next topic » 
Author Message
scravr
PostPosted: Wed Oct 01, 2008 3:29 pm    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

the msg-type is in 2 first bytes.
basically, i am getting like "cobol-redefined" msgs with diff lenght (20 or 25 bytes). first 2 bytes are msg-type.
how can i choice between both?
do i need a choice? or anyother solution?
sample xsd? mxsd?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
kimbert
PostPosted: Thu Oct 02, 2008 12:37 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5543
Location: Southampton

Quote:
the msg-type is in 2 first bytes
Aha! That's a very important item of information. In that case, you can use the 'message alias' support introduced in v6.0 to resolve the message based on the msg-type value.

- Create a message set containing all of your message definitions. Remember that they do not all have to be in a single mxsd!
- Create one more message definition, called 'MsgHeader'. It should have exactly two members.
1) a field called 'msgtype' of type xs:string.
2) a local group with Composition set to 'Message'.
- On msgtype, set 'Interpret Element Value As' to 'Message Key'.
- On each 'real' message definition, set the 'Message Alias' property to the msgtype value which identifies that message.
- In each message definition, remove the msgtype field ( because it gets parsed by the MsgHeader message definition )
Back to top
View user's profile Send private message
scravr
PostPosted: Fri Oct 03, 2008 10:09 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

Yes, it works (with few modifications).
Here is a problem: I have this multi-part message:
A1CRMAUK0SEC-XYZ-1 020510113000AUTH
/TYPE/DELV
/SEC/31912345
/TO/021018 BANK NAME/CLIENT NAME/USER NAME
/PAR/25000
/AMT/25987.57
/INS/REGULAR DELIVERY
/DATE/05-16-02
//

The first line (A1CRM....) is fix length header. Bytes 3-5 (value CRM) are pointing (as MessageIdentity) to multipart-msg-type defined on same msg definition.
The last line (//) is the trailer.
All other lines are part of CRM message. Each line has variable length tag. Each data-value is variable length. Data can contain all chars like * . , / \ # $ ..... that means / can apear as a tag beginner/delimiter and as part of data text.

I have this mxsd but it does not work. It allways takes fix-length for data even when <CR><LF> split the data lines.

What will be the best way to define msg-set pysical/logical formats?
Should I have the msg-set as TDS, Binary, or other format?

Here are mset and mxsd:

messageSet.mset file:
<?xml version="1.0" encoding="UTF-8"?>
<msgCoreModel:MRMessageSet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:MSGModel="http://www.ibm.com/msgmodel/2003/MSGModel" xmlns:msgCoreModel="http://www.ibm.com/msgmodel/2003/MSGCoreModel" name="MS_SEC_DLV_AMOR_BNY98" msetVersionNo="" currentMessageSetId="//@MRMessageSetID.0">
<MRMessageSetRep xsi:type="MSGModel:MRTDSMessageSetRep" name="BNY_AMOR_FRMT" centuryWindow="53" timeZoneID="0" allowLenientDateTimes="false" messagingStandard="Unknown" groupIndicator="" groupTerminator="&lt;CR>&lt;LF>" decimalPoint="." reservedChars="" outputCompressionTechnique="None" inputCompressionTechnique="None" defaultCCSID="367" booleanTrueRepresentation="1" booleanFalseRepresentation="0" booleanNullRepresentation="0" delimiter="&lt;CR>&lt;LF>" trimFixLengthString="NoTrim" deriveDefaultLengthFromLogicalType="true" deriveDefaultSignFromLogicalType="true"/>
<MRMessageSetRep xsi:type="MSGModel:MRXMLMessageSetRep" name="BNY_AMOR_XML" timeZoneID="0" allowLenientDateTimes="false" suppressDOCTYPE="true" doctypeSystemID="www.mrmnames.net/LRI463K002001" doctypePublicID="LRI463K002001" rootTagName=""/>
<MRMessageSetRep xsi:type="MSGModel:MRCWFMessageSetRep" name="BNY_SIMPLE_BINARY_FRMT" daysInFirstWeekOfTheYear="Four" firstDayOfWeek="Monday" timeZoneID="0" allowLenientDateTimes="false"/>
<MRMessageSetID repositoryId="-1110931939" messageSetId="1"/>
</msgCoreModel:MRMessageSet>



MD_SEC_DLV_AMOR_BNY98.mxsd file:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="DateTag" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="6" messageSetDefaultRep="BNY_AMOR_FRMT" paddingCharacter="NUL" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Date" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="8" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1" tag="/DATE/"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="InstructionsTag" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="5" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Instructions" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="80" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1" tag="/INS/"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="AmountTag" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="5" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Amount" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="20" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1" tag="/AMT/"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="SecurityTag" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1" render="Characters"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Secutity" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1" render="NullTerminatedString" tag=""/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="ParTag" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="5" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="PAR" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="18" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1" tag="/PAR/"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="ToTag" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="4" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="TO" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="100" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1" tag="/TO/"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="TypeTag" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="6" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Type" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="10" messageSetDefaultRep="BNY_AMOR_FRMT" paddingCharacter="SPACE" precision="-1" render="Characters" tag=""/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="GramType" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRMSGLogicalModelExtension_logicalModelExtension interpretValueAs="MessageIdentity"/>
<tdsElemRep length="2" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="MsgType" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRMSGLogicalModelExtension_logicalModelExtension interpretValueAs="MessageIdentity"/>
<tdsElemRep length="3" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="AcctId" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="3" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="MsgRef" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="20" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="MsgDate" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="6" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="MsgTime" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="6" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Auth" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="4" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="ElementLength1" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="1" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="HeaderType">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRComplexType composition="orderedSet"/>
<tdsStructRep groupIndicator="" groupTerminator="&lt;CR&gt;&lt;LF&gt;" messageSetDefaultRep="BNY_AMOR_FRMT"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence maxOccurs="1" minOccurs="1">
<xsd:element ref="GramType"/>
<xsd:element ref="MsgType"/>
<xsd:element ref="AcctId"/>
<xsd:element ref="ElementLength1"/>
<xsd:element ref="MsgRef"/>
<xsd:element ref="MsgDate"/>
<xsd:element ref="MsgTime"/>
<xsd:element ref="Auth"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element fixed="//" name="EndOfMsg" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep length="2" messageSetDefaultRep="BNY_AMOR_FRMT" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="EomType">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRComplexType composition="orderedSet"/>
<tdsStructRep groupIndicator="" groupTerminator="" messageSetDefaultRep="BNY_AMOR_FRMT"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence maxOccurs="1" minOccurs="1">
<xsd:element ref="EndOfMsg"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="HDR" type="HeaderType"/>
<xsd:complexType name="CRM">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRComplexType composition="orderedSet" content="openDefined"/>
<tdsStructRep dataElementSeparation="FixedLength" delimiter="&lt;CR&gt;&lt;LF&gt;" groupIndicator="" groupTerminator="&lt;CR&gt;&lt;LF&gt;" messageSetDefaultRep="BNY_AMOR_FRMT"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence maxOccurs="1" minOccurs="1">
<xsd:element ref="TypeTag"/>
<xsd:element ref="Type"/>
<xsd:element ref="SecurityTag"/>
<xsd:element ref="Secutity"/>
<xsd:element ref="ToTag"/>
<xsd:element ref="TO"/>
<xsd:element ref="ParTag"/>
<xsd:element ref="PAR"/>
<xsd:element ref="AmountTag"/>
<xsd:element ref="Amount"/>
<xsd:element ref="InstructionsTag"/>
<xsd:element ref="Instructions"/>
<xsd:element ref="DateTag"/>
<xsd:element ref="Date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="CRM" type="CRM">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRMessage messageDefinition="/0/CRM;XSDElementDeclaration=24$MRObject">
<MRMSGLogicalModelExtension_logicalModelExtension messageAlias="CRM"/>
</MRMessage>
<MRMSGLogicalModelExtension_logicalModelExtension messageAlias="CRM"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="GlobalMsgType">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsStructRep dataElementSeparation="VariableLengthElementsDelimited" delimiter="&lt;CR&gt;&lt;LF&gt;" groupTerminator="" messageSetDefaultRep="BNY_AMOR_FRMT"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element ref="HDR"/>
<xsd:element name="Message">
<xsd:complexType>
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRComplexType composition="message" content="openDefined"/>
<tdsStructRep dataElementSeparation="Undefined" delimiter="//" groupTerminator="&lt;CR&gt;&lt;LF&gt;" messageSetDefaultRep="BNY_AMOR_FRMT"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="xsd:anyType">
<xsd:choice maxOccurs="1" minOccurs="1"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element ref="EomType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="EomType" type="EomType"/>
<xsd:element name="GlobalMsg" type="GlobalMsgType">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRMessage messageDefinition="/0/GlobalMsg;XSDElementDeclaration=26$MRObject"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:schema>
Back to top
View user's profile Send private message Send e-mail MSN Messenger
kimbert
PostPosted: Sat Oct 04, 2008 11:43 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5543
Location: Southampton

OK - this should really be a new thread. This is a 'how do I model this TDS format' question.
Quote:
The first line (A1CRM....) is fix length header. Bytes 3-5 (value CRM) are pointing (as MessageIdentity) to multipart-msg-type defined on same msg definition.
Good - that sounds like the correct strategy.
Quote:
All other lines are part of CRM message. Each line has variable length tag. Each data-value is variable length.
All right so far. You can use Tagged Delimited with Tag Data Separator set to '/'.
Quote:
Data can contain all chars like * . , / \ # $ ..... that means / can apear as a tag beginner/delimiter and as part of data text.
This cannot be true unless you are omitting some other detail about these fields. It would not be possible to parse your message if the delimiter could appear *anywhere* in *any* delimited field. Maybe the final field is the only one which is variable length? Or maybe all of the fields are at least N characters long? Please clarify.

Quote:
What will be the best way to define msg-set pysical/logical formats?
Should I have the msg-set as TDS, Binary, or other format?
I have looked at your mxsd, and I don't think you will solve this one on your own, so here's my suggestion.

- Use TDS for this and any other format which has tags and/or delimiters.
- You header definition looks OK
- You should be using Tagged Delimited to identify and parse the tagged lines.
- Tag Data Separator '/', delimiter <CR><LF>
- You should not be using Variable Length Elements Delimited unless you understand what it means. You almost certainly should be using All Elements Delimited instead.
- The elements which represent the individual lines should each have the Tag property set. and their complex types should be All Elements Delimited with Delimiter='/'.
- The closing // should be modelled as the Group Terminator of the inner message.

This should set you off in the right direction. Normally I would write out the definition explicitly, but I don't have time right now, and your message format is quite large and complex.

Finally, *please* make use of debug-level user trace to diagnose any remaining problems ( assuming that you are on v6.1). It really can help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Broker 6.1: XSD and mapping
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.