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 » Message Broker Toolkit : message definition query

Post new topic  Reply to topic
 Message Broker Toolkit : message definition query « View previous topic :: View next topic » 
Author Message
sudeepm
PostPosted: Thu May 29, 2008 9:29 pm    Post subject: Message Broker Toolkit : message definition query Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

Hi all,
this is a general query regarding creating message definitions. My input message is of the format :
<Header>
<Line>
<Line>
<Line>
......
<Tralier>
That is,there is only one header,infinite number of line items and then only one trailer. There are no tags for the header or line or trailer. Also,the fields are fixed length.If I define the message definition setting the minOccurs/maxOccurs as 1/-1 for the line element and try to parse a message with 3 line elements using this message definition,what the MB does is it creates 3 line elements and then tries to parse the trailer element considering it as a line element,which seems obvious because there is no way for the MB to identify what the occurrence of line item is.

What i want to know is....is there a way to configure the msg defn to parse the very last line of the message as the trailer,the first line as the header and everything in between as line elements. One way obviously is to add tags for header,line and trailer elements but i wud like to avoid changing my message structure.

so if someone cud suggest sumthing,it wud be grt!!
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri May 30, 2008 1:19 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
What i want to know is....is there a way to configure the msg defn to parse the very last line of the message as the trailer,the first line as the header and everything in between as line elements
You need to set Data Element Separation to 'Use Data Pattern' on the outermost complex type. Then set a Data Pattern on Header, Line, Trailer. I cannot advise you on what the data patterns should be, because I haven't seen your data. However, if we assume that the length of the lines is different, then you could do this:
Code:
Message
    Complex Type DataElementSeparation="Use Data Pattern", Composition=Choice, maxOccurs=-1
        Header  DataPattern=".*{10}\r\n"
        Line  DataPattern=".*{20}\r\n"
        Trailer  DataPattern=".*{5}\r\n"
Note that this will allow any number of Headers, Lines and Trailers in any order. There may be a more complex model which will validate the input more strictly.
Back to top
View user's profile Send private message
sudeepm
PostPosted: Tue Jun 03, 2008 7:34 pm    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

kimbert wrote:
Quote:
What i want to know is....is there a way to configure the msg defn to parse the very last line of the message as the trailer,the first line as the header and everything in between as line elements
You need to set Data Element Separation to 'Use Data Pattern' on the outermost complex type. Then set a Data Pattern on Header, Line, Trailer. I cannot advise you on what the data patterns should be, because I haven't seen your data. However, if we assume that the length of the lines is different, then you could do this:
Code:
Message
    Complex Type DataElementSeparation="Use Data Pattern", Composition=Choice, maxOccurs=-1
        Header  DataPattern=".*{10}\r\n"
        Line  DataPattern=".*{20}\r\n"
        Trailer  DataPattern=".*{5}\r\n"
Note that this will allow any number of Headers, Lines and Trailers in any order. There may be a more complex model which will validate the input more strictly.


hey buddy...thx a lot....it worked perfect...wasnt aware of the data pattern option... the data pattern that i used was .{10}\r\n and similarly for other elements.
thx a lot again!!
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 » Message Broker Toolkit : message definition query
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.