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 » Use of CWF and TDS together

Post new topic  Reply to topic
 Use of CWF and TDS together « View previous topic :: View next topic » 
Author Message
Sonal
PostPosted: Fri Dec 10, 2010 12:22 pm    Post subject: Use of CWF and TDS together Reply with quote

Apprentice

Joined: 20 Mar 2009
Posts: 45

Hi Experts,

I've a requirement wherein Im getting an XML request message and our MB broker has to transform it into a message such that, the first 100 bytes of the mesg is in Fixed layout and the rest of the mesg in tilde (~) separated format. I've done from XML to Fixed layout by making the wire format as 'CWF'. And for XML to tilde by making the message format as 'TDS'. But here, a part of the XML message has to be tranformed into Fixed record and the other part in TDS. Final message from broker will be the combonation of both.
Is there a way in which I can accomodate two type of wire format into a single output message?

Sample input XML:

<Message>
<Header>
<Name>John</Name>
<Address>USA</Address>
<Phone>2487895634</Phone>
<DOB>101075</DOB>
</Header>
<Body>
<Children>2</Children>
<Employer>IBM</Employer>
<Country>USA</Country>
<State>MI</State>
</Body>
</Message>


Sample output:

JohnUSA24878956341010752~IBM~USA~MI%%



PLease help me...
Many thanks in advance.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 10, 2010 12:27 pm    Post subject: Re: Use of CWF and TDS together Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Sonal wrote:
Is there a way in which I can accomodate two type of wire format into a single output message?


Yes. Please review the samples, the documentation, the tutorial in this forum someplace and the posts of kimbert.

Then please post again if you have specific problems.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Dec 10, 2010 12:49 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

There doesn't appear to be a reason to use CWF at all.
Back to top
View user's profile Send private message
Sonal
PostPosted: Fri Dec 10, 2010 1:01 pm    Post subject: Reply with quote

Apprentice

Joined: 20 Mar 2009
Posts: 45

Then, how can it be achieved by just using TDS?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Dec 10, 2010 1:06 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Sonal wrote:
Then, how can it be achieved by just using TDS?


TDS handles fixed width fields just as easily as delimited fields.

You just have to construct the model correctly.
Back to top
View user's profile Send private message
Sonal
PostPosted: Fri Dec 10, 2010 1:08 pm    Post subject: Reply with quote

Apprentice

Joined: 20 Mar 2009
Posts: 45

Ok. To be more specific, the problem is...

Requesting system is sending one XML input in two parts. The first one is a standard header that we maintain for all the requesting system. And, the second part is the payload which is application specific.

Now when the first part i.e the header is transformed into FR, the length has to be 100 bytes. Having said that i mean to say, suppose the value of a field in XML is '23' but the max length for it is 5... then in the transofrmed request mesg it must come as '00023'.

The target system while processing the request mesg simply discard the first 100 bytes and then starts processeing the application mesg.

So, is there a way to do so without using CWF or just TDS alone?
pls help... im trying to find the posts by kimbert... came across several posts regarding TDS but havent found anything pertaining similar to this...

Pls help... thankss...
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Dec 10, 2010 2:00 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

TDS has always supported fixed length text fields. Since v6.1, TDS has also supported all of the non-text physical types that CWF offers. So it's highly likely that TDS can do everything that you need.
Quote:
Now when the first part i.e the header is transformed into FR, the length has to be 100 bytes. Having said that i mean to say, suppose the value of a field in XML is '23' but the max length for it is 5... then in the transformed request mesg it must come as '00023'.
That looks like a text number with fixed length of 5 and left-padded with zeros. In CWF that's an external decimal with length 5 and pad char zero. In TDS it's an integer with length 5 and physical type Text and padding character zero. Presumably there are other, non-integer fields in the header, but you should be able to do what you need to in TDS. If not, please explain clearly what you cannot do.
Quote:
The target system while processing the request mesg simply discard the first 100 bytes and then starts processing the application mesg.
Great. So you *could* just create a message definition for the second part, and simply add 100 space characters onto the front before you write out the message. I'm not saying that you *should* do that - there may be a good reason why the architect decided to specify this header.
Back to top
View user's profile Send private message
Sonal
PostPosted: Fri Dec 10, 2010 2:02 pm    Post subject: Reply with quote

Apprentice

Joined: 20 Mar 2009
Posts: 45

Just to rephrase my problem:

Consider this:


Fields Max length
Name 10
Address 10
Phone 10
DOB 10
Children 1
Employer 10
Country 6
State 2



Now, as per my situation, the input XML is as follows:

<Message>
<Header>
<Name>John</Name>
<Address>USA</Address>
<Phone>2487895634</Phone>
<DOB>101075</DOB>
</Header>
<Body>
<Children>2</Children>
<Employer>IBM</Employer>
<Country>USA</Country>
<State>MI</State>
</Body>
</Message>


In output, the fields from Name to DOB needs to be generated in fixed layout i.e with proper length n padding characters.

John USA 24878956340000101075

Hence, no matter how the input values are... the first part of my transformed output mesg has to be 40 bytes. This part of mesg will be discarded by the target end. It will simply remove the first 40 bytes and then start processeing. But, as per the standard, we've to maintain this 40 bytes attached to the payload (application specific data) while sending to target system.


However, for the rest of the XML... I want a tilde (~) separated mesg.

So, my complete mesg becomes :

John USA 24878956340000101075~IBM~USA~MI%%



Thats why i thought that the first part of XML mesg wud be parsed like CWF format and the rest in TDS.
Correct me if my understandning of problem and assumptions are wrong n if we cud do it in more smarter way.

pls help...

Thanks a ton!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Dec 10, 2010 2:45 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Construct a TDS model.

The message has two children.

One is an element of a type that contains the definition of the components of your "John USA 24878956340000101075".

The second is an element of a type that contains the definition of the components of your "~IBM~USA~MI%%".

What is the issue here? What are you failing to get?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Dec 10, 2010 2:46 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

To be fair, I am using the phrase "an element of the type".

It may not strictly end up being an actual element. It may, for example, be the type itself.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Dec 10, 2010 3:07 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Hence, no matter how the input values are... the first part of my transformed output mesg has to be 40 bytes. This part of mesg will be discarded by the target end. It will simply remove the first 40 bytes and then start processeing. But, as per the standard, we've to maintain this 40 bytes attached to the payload (application specific data) while sending to target system.
However, for the rest of the XML... I want a tilde (~) separated mesg.


You seem to have a poor understanding of what the TDS parser can do. It can parse/write fixed length and delimited data in the same message.

You need two complex elements in your message, each with its own complex type. You need to set the TDS property 'Data Element Separation' to 'Fixed Length' in the first complex type, and 'All Elements Delimited' in the second complex type.
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 » Use of CWF and TDS together
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.