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 » Another TDS question

Post new topic  Reply to topic
 Another TDS question « View previous topic :: View next topic » 
Author Message
TonyD
PostPosted: Wed Jan 11, 2006 1:48 pm    Post subject: Another TDS question Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

We have a tagged delimited message that, at first appearance, should be fairly straightforward to define:

Code:


Message (ComplexType. All Elements Delimited, <CR><LF>)
          Line  (Group, 1/-1, TaggedDelimited)
                    Header (ComplexType, 1/1, Fixed Length, tag 'H')
                    Body  (Group, 1/1, Tagged Delimited, <CR><LF>)
                              BodyHeader (ComplexType, 1/1, Fixed Length, tag 'E')   
                              BodyDetail (ComplexType, 1/-1, Fixed Length, tag 'F')
                    Trailer (ComplexType, 1/1, Fixed Length, tag 'Z')                       
     


In other words, there can be 1-n 'Lines' and each 'Line' consists of one 'Header', 1-n 'BodyHeader'/'BodyDetail' sets, and one 'Trailer'. All elements are Fixed Length, have a one-character tag, and are delimited with <CR><LF>. The application is deployed in WBI V6.

The 'Body'group has no tag or delimiter in the message. However the parser appears to require that 'Body' is terminated with <CR><LF>, i.e. after the <CR><LF> that terminates the last 'BodyDetail' in the set. I can see why this could be the case as its parent 'Line' specifies 'TaggedDelimited'. However I cannot work out how to specify that all elements are delimited apart from 'Body'.

I have read the section on multipart messages which would seem to be an alternative but this appears to require the presence of a 'MessageKey' (or 'MessageIdentity') element in the header; in the above case the 'Body' does not have an identifier.
Back to top
View user's profile Send private message Send e-mail
elvis_gn
PostPosted: Wed Jan 11, 2006 8:34 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi TonyD,

I understand what you are saying, and see that you have realised most of it yourself, but then what do u actually want ?

Ur Line is defined as TaggedDelimited complex type with delimiter <CR><LF>.

In Line you have Header, Body and Trailer, right ?

This would mean that, at the end of your last BodyDetail(which is the end of body itself) it would expect a <CR><LF> before the Trailer...which you agree to also.

Quote:
However I cannot work out how to specify that all elements are delimited apart from 'Body'.

Arent all elements already delimited by <CR><LF>............

Or is it that you dont want delimiters inside Body....If so then dont give a delimiter in the complex type Body....which I think you have done also.

And now I think what you want is that the <CR><LF> after body also does not come....right ?
Well you said it yourself, that one is not due to body but due to Line.
If you still wanna get rid of it....you'll have to put the body and trailer into another complex type with no delimiters between them.

Have I got your problem, or you could just clarify that again, say with a sample.

Regards.
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Jan 12, 2006 1:24 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Its probably best to post an example message, showing what you are getting and what you would like to get.
Back to top
View user's profile Send private message
TonyD
PostPosted: Thu Jan 12, 2006 12:05 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Yes, I realised that my explanation is a bit difficult to decipher !

A message looks like this:

Quote:


Hhhhhhhhhhhhhhh0d0a
Eeeeeeeee0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a
Eeeeeeeee0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a
Zzzzzzzz0d0a



The above is defined as the 'Line' group. The E/FF sets are defined as the 'Body' group. Currently parsing fails unless I alter the message to:

Quote:

Hhhhhhhhhhhhhhh0d0a
Eeeeeeeee0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a0d0a
Eeeeeeeee0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a0d0a
Zzzzzzzz0d0a


:which I do not want to do. So far I have not been able to work out how to specify that the 'Body' group, unlike the other elements in 'Message', is not delimited.
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Jan 12, 2006 12:19 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Your message should be modeled in the following manner
* Message
** Header -
*** H - delimiter "<CR><LF>", no Group terminator
****H fields
**Body - no delimiter, no group terminator
***E - delimiter "<CR><LF>", no group terminator, occurs 1
****E fields
***F - delimiter "<CR><LF>", no group terminator, ocurrs 0 to many
****F fields
**Trailer
***Z - delimiter "<CR><LF>", no group terminator
****Z Fields
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
TonyD
PostPosted: Fri Jan 13, 2006 12:45 am    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Jeff,
Thanks for the guidance. However I am not sure how to apply the delimiters in the way you suggest.

Currently I have the following defined at the Types level:

Message_Type - All Elements Delimited - Delimiter <CR><LF>
Line (Group) - TaggedDelimited - No Group Ind/Term or Delimiter
Header_Type - Fixed Length - No Group Ind/Term or Delimiter
Body (Group)- TaggedDelimited - No Group Ind/Term or Delimiter
BodyHeader_Type - Fixed Length - No Group Ind/Term or Delimiter
BodyDetail_Type- Fixed Length - No Group Ind/Term or Delimiter
Trailer_Type- Fixed Length - No Group Ind/Term or Delimiter

The compound elements (Header, BodyHeader, BodyDetail, Trailer) each have the Tag specified in TDS/GlobalElement/Field Identification.

Message_Type has Sequence/Closed, Line has Choice/Open, Body has Sequence/Closed.

The DES properties for Line and Body are constrained by the DES of AllElementsDelimited at the Message Level.

When you say:
Quote:


Your message should be modeled in the following manner
* Message
** Header -
*** H - delimiter "<CR><LF>", no Group terminator
****H fields


:could you show how this would be specified. Currently I have no delimiters specified at the type level apart from the highest level i.e.Message.
Back to top
View user's profile Send private message Send e-mail
elvis_gn
PostPosted: Fri Jan 13, 2006 2:10 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi TonyD,

First of all remove the Delimiter from the Message Type.

For Line(Complex Type) set the Delimiter as <CR><LF>.

For Header(Complex Type), do not specify any Delimiter.

For Body(Complex Type) specify the delimiter as <CR><LF>

For BodyHeader do not specify anything.

Next specify a complex type which will contain only BodyDetails(increase max occurances of this complex type), set its delimiter as <CR><LF>.

Put BodyDetails(max occurances 1) under it and dont set any delimiter.

For trailer dont specify an delimiter.

Regards.
Back to top
View user's profile Send private message Send e-mail
juddg
PostPosted: Fri Jan 13, 2006 3:00 am    Post subject: Try the following model Reply with quote

Apprentice

Joined: 22 Nov 2004
Posts: 33

Hi TonyD,
I have sucessfully modelled your sample message as follows :

For the purposes of the example I have modelled the Header, BodyHeader, BodyDetail and Trailer as Strings.

Code:

message
   <ComplexType> - Sequence - TaggedDelimited - Fixed Length Tag = 1 - Group Terminator = <CR><LF> - Delimiter = <CR><LF>
       Header - type String - MaxOccurs = 1 - Tag = 'H'
       <sequence> - MaxOccurs = -1 - Tagged Delimited - Fixed Length Tag = 1 Delimiter = <CR><LF>
           BodyHeader - type = String - maxOccurs = 1 - Tag = 'E'
           BodyDetail - type = String - maxOccurs = -1 - Tag = 'F'
       Trailer - type = String - maxOccurs = 1 - Tag = 'Z'


On parse ths produces the following tree.

Code:

 (0x0100001B):MRM        = (
    (0x0300000B):Header     = 'hhhhhhhhhhhhhh'
    (0x0300000B):BodyHeader = 'eeeeeeee'
    (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
    (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
    (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
    (0x0300000B):BodyHeader = 'eeeeeeee'
    (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
    (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
    (0x0300000B):Trailer    = 'zzzzzzz'
  )


If you have multiple 'header, body, trailer' lines in the message use the following model :

Code:

message
   <ComplexType> - Sequence - TaggedDelimited - Fixed Length Tag = 1 - Group Terminator = <CR><LF> - Delimiter = <CR><LF>
       <sequence> - MaxOccus = -1 - Tagged Delimited - Fixed Length Tag = 1 - Delimiter = <CR><LF>
          Header - type String - MaxOccurs = 1 - Tag = 'H'
          <sequence> - MaxOccurs = -1 - Tagged Delimited - Fixed Length Tag = 1 -  Delimiter = <CR><LF>
              BodyHeader - type = String - maxOccurs = 1 - Tag = 'E'
              BodyDetail - type = String - maxOccurs = -1 - Tag = 'F'
          Trailer - type = String - maxOccurs = 1 - Tag = 'Z'


Both the above models will produce flat trees. If you want a structure where each line is a separate element and each body is a separate element use the following model.

Code:

message
   <ComplexType> - Sequence - TaggedDelimited - Fixed Length Tag = 1 - Group Terminator = <CR><LF> - Delimiter = <CR><LF>
       Line - MaxOccurs = -1 - (no Tag)
         <ComplexType> - sequence - Tagged Delimited - Fixed Length Tag = 1 - Delimiter = <CR><LF>
              Header - type String - MaxOccurs = 1 - Tag = 'H'
              Body - MaxOccurs = -1 - (no Tag)
                 <ComplexType> - sequence - Tagged Delimited - Fixed Length Tag = 1 -  Delimiter = <CR><LF>
                     BodyHeader - type = String - maxOccurs = 1 - Tag = 'E'
                     BodyDetail - type = String - maxOccurs = -1 - Tag = 'F'
              Trailer - type = String - maxOccurs = 1 - Tag = 'Z'


For input message :

Hhhhhhhhhhhhhhh
Eeeeeeeee
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Eeeeeeeee
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Zzzzzzzz
Hhhhhhhhhhhhhhh
Eeeeeeeee
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Eeeeeeeee
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Zzzzzzzz
Hhhhhhhhhhhhhhh
Eeeeeeeee
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Eeeeeeeee
Fffffffffffffffffffffffff
Fffffffffffffffffffffffff
Zzzzzzzz

it produces the following tree :

Code:

  (0x0100001B):MRM        = (
    (0x01000013):Line = (
      (0x0300000B):Header  = 'hhhhhhhhhhhhhh'
      (0x01000013):Body    = (
        (0x0300000B):BodyHeader = 'eeeeeeee'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
      )
      (0x01000013):Body    = (
        (0x0300000B):BodyHeader = 'eeeeeeee'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
      )
      (0x0300000B):Trailer = 'zzzzzzz'
    )
    (0x01000013):Line = (
      (0x0300000B):Header  = 'hhhhhhhhhhhhhh'
      (0x01000013):Body    = (
        (0x0300000B):BodyHeader = 'eeeeeeee'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
      )
      (0x01000013):Body    = (
        (0x0300000B):BodyHeader = 'eeeeeeee'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
      )
      (0x0300000B):Trailer = 'zzzzzzz'
    )
    (0x01000013):Line = (
      (0x0300000B):Header  = 'hhhhhhhhhhhhhh'
      (0x01000013):Body    = (
        (0x0300000B):BodyHeader = 'eeeeeeee'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
      )
      (0x01000013):Body    = (
        (0x0300000B):BodyHeader = 'eeeeeeee'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
        (0x0300000B):BodyDetail = 'ffffffffffffffffffffffff'
      )
      (0x0300000B):Trailer = 'zzzzzzz'
    )
  )

I hope this helps,

Regards,

juddg.
Code:
Back to top
View user's profile Send private message
TonyD
PostPosted: Fri Jan 13, 2006 1:13 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Thanks guys, your help much appreciated.
One further point....when showing what the message looked like earlier:

Code:

Hhhhhhhhhhhhhhh0d0a
Eeeeeeeee0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a
Eeeeeeeee0d0a
Fffffffffffffffffffffffff0d0a
Fffffffffffffffffffffffff0d0a
Zzzzzzzz0d0a


I should have been more specific to explain that the 'hhh', eee', 'fff',etc. represents in each case several fixed length fields; each line is therefore a fixed length complex type with a one-character tag, 1-n fields with length specified, and a '0d0a' terminator. Does this alter your suggested solutions?
Back to top
View user's profile Send private message Send e-mail
elvis_gn
PostPosted: Sun Jan 15, 2006 8:35 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

No, it shouldn't...

If it does, let us know

Regards.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Another TDS question
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.