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 » Creating WMQ headers from XML strings

Post new topic  Reply to topic
 Creating WMQ headers from XML strings « View previous topic :: View next topic » 
Author Message
Cerberus1
PostPosted: Tue Jul 19, 2005 7:03 am    Post subject: Creating WMQ headers from XML strings Reply with quote

Newbie

Joined: 19 Jul 2005
Posts: 3
Location: Boeblingen, Germany

How can I create any WMQ header from an XML formatted string containing the WMQ header data?

e.g. following XML string contains a Properties folder, an MQMD and MQRFH2 folder and I want to create the appropriate headers in the message tree.

<Root><Properties><MessageSet></MessageSet><MessageType></MessageType><MessageFormat></MessageFormat><Encoding>546</Encoding><CodedCharSetId>0</CodedCharSetId><Transactional>TRUE</Transactional><Persistence>FALSE</Persistence><CreationTime>2005-07-19 10:02:26.410</CreationTime><ExpirationTime>-1</ExpirationTime><Priority>0</Priority><ReplyIdentifier>4d5157495a00000000000000000000000000000000000000</ReplyIdentifier><ReplyProtocol>MQ</ReplyProtocol><Topic></Topic></Properties><MQMD><SourceQueue>MAF_IN</SourceQueue><Transactional>TRUE</Transactional><Encoding>546</Encoding><CodedCharSetId>437</CodedCharSetId><Format>MQHRF2</Format><Version>2</Version><Report>0</Report><MsgType>8</MsgType><Expiry>-1</Expiry><Feedback>0</Feedback><Priority>0</Priority><Persistence>0</Persistence><MsgId>414d51205742494d42353020202020207dacdc4220001a01</MsgId><CorrelId>4d5157495a00000000000000000000000000000000000000</CorrelId><BackoutCount>0</BackoutCount><ReplyToQ> </ReplyToQ><ReplyToQMgr>WBIMB50 </ReplyToQMgr><UserIdentifier>axfdtte </UserIdentifier><AccountingToken>7736430005999938882abc3555244c07e53b2beb03000000000000000000000b</AccountingToken><ApplIdentityData> </ApplIdentityData><PutApplType>11</PutApplType><PutApplName>s\sources\mqia_new\mqwiz.exe</PutApplName><PutDate>2005-07-19</PutDate><PutTime>10:02:26.410</PutTime><ApplOriginData> </ApplOriginData><GroupId>000000000000000000000000000000000000000000000000</GroupId><MsgSeqNumber>1</MsgSeqNumber><Offset>0</Offset><MsgFlags>0</MsgFlags><OriginalLength>-1</OriginalLength></MQMD><MQRFH2><CodedCharSetId>1208</CodedCharSetId><NameValueCCSID>1208</NameValueCCSID><Test><Dnq><Completion><Code>Ok</Code></Completion></Dnq></Test><Format></Format><mcd><Msd>none</Msd></mcd></MQRFH2></Root>
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 19, 2005 7:07 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You'll have to use "Set".

I don't think you can use the Mapping nodes, even if you made a message set for your XML.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Cerberus1
PostPosted: Tue Jul 19, 2005 7:18 am    Post subject: Reply with quote

Newbie

Joined: 19 Jul 2005
Posts: 3
Location: Boeblingen, Germany

The problem with the Set is that I don't know the type of the single header fields. Because I have to support any WMQ header I can't do it hard coded. When I use the Set for a header field of type integer I will get an error because the value in the XML string is of type character. And I currently found no way to determine the type of the different header fields.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 19, 2005 7:31 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Cerberus1 wrote:
The problem with the Set is that I don't know the type of the single header fields. Because I have to support any WMQ header I can't do it hard coded. When I use the Set for a header field of type integer I will get an error because the value in the XML string is of type character. And I currently found no way to determine the type of the different header fields.


You will have to code a big CASE statement based on the field name, and use CAST as necessary, and code for error handling. The types for each of the header fields are completely documented in the Application Programming Reference.

You could attempt a tree copy, from InputRoot.XML.MQMD to OutputRoot.MQMD, and hope that the parsers will handle this for you. I won't guarantee it, though.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Cerberus1
PostPosted: Tue Jul 19, 2005 8:06 am    Post subject: Reply with quote

Newbie

Joined: 19 Jul 2005
Posts: 3
Location: Boeblingen, Germany

I already tried all this things you mentioned. Unfortunately the parsers don't handle this for me on a tree copy. And I don't want to code the big CASE statement. In other words, there is no way in doing this.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 19, 2005 8:08 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There is a way of doing this.

You don't like it, but it's there.

_________________
I am *not* the model of the modern major general.
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 » Creating WMQ headers from XML strings
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.