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 » Parsing or writing of the message

Post new topic  Reply to topic
 Parsing or writing of the message « View previous topic :: View next topic » 
Author Message
mqxplorer
PostPosted: Fri Jan 06, 2012 12:14 pm    Post subject: Parsing or writing of the message Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi All,

When I do message transformation, can be from cobol to xml/xml to cobol or one_xml_format to other_xml_format, in the target message created I specify the message set name(optionally, message type and message format) in the properties folder for all the model driven parsers (we create message sets for xml messages also). I have not seen my colleagues setting up the message set name in the properties folder for any of the flows where they are doing message transformation from one_xml_format to other_xml_format and they do not see any issues while the bit stream is fomred from the message tree at the output node. I was really confused and went back to read the documentation one more time.

The documentation says:

Code:
To write a message, the broker calls the owning body parser to create the message bit stream from the message tree. If the parser is a model-driven parser, it uses the MessageSet, MessageType, and MessageFormat fields in the Properties folder. Whether Message Type or Message Format are needed depends on the message domain.

When you use a model-driven parser, you must also specify the Message Set and, optionally, the Message Type and Message Format so that the parser can locate the deployed message definition with which to guide the parsing or writing of the message.


I started expermineting with a sample flow where I get an xml message message and I do not do any tranformation, however, I set the message set name to a different message set in the properties folder which is used for a different message. When the message is put in the output queue, it never compalined. I thought, the parser uses the message set name set in the properties folder to create the message bit stream from the message tree and it will complain which did not happen. Then I decided to set the Validation to "Content and Value" on the Output node and tested again and it throws an exception...

Code:
A schema validation error has occurred while validating the message tree


I am confused at this step ..... This makes me believe that the message bit stream formation does not really use the message set name, instead, it is using the message domain name in forming the message without complaning as it is an xml message, however, during validation of the message it really uses the message set name set in the properties folder. After seeing this behavior, I feel like setting up the message set name in the properties folder is not really needed... Is that right???

I am trying to understand this little more in depth. I am sure there are lot of experts in this forum who can help me understand this concept. Could someone help me understand this concept?

Thanks in advance.

Thanks
mqxplorer
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 06, 2012 2:10 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

The documentation I thought was clear on that:
Code:
When you use a model-driven parser, you must also specify the Message Set and, optionally, the Message Type and Message Format so that the parser can locate the deployed message definition with which to guide the parsing or writing of the message.


This really means that when you use an XML parser (XMLNS, XMLNSC) the model XML is inherent and no Message set is needed.
If you want to do validation you will need to use the XMLNSC parser and will need a Messages set.

For all other parser domains (MRM) you will need a Message set or serialization will not happen.

Kimbert will probably correct me there, but I hope I gave you the "easy" answer on this one.
_________________
MQ & Broker admin


Last edited by fjb_saper on Fri Jan 06, 2012 9:10 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Fri Jan 06, 2012 2:31 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Short answer: you don't need a message set if you are using XMLNS or XMLNSC. But it's almost always a good idea anyway because it makes the ESQL coding easier.

Longer answer:

The MRM domain always requires a message set - it cannot work without it.

XMLNS can parse an XML document or write a message tree as XML without a message set. In fact, XMLNS cannot use a message set at all. It cannot validate against an XML schema.

XMLNSC can parse an XML document or write a message tree as XML without a message set. Additionally, XMLNSC can validate your XML document or your message tree against a message set ( or in v8, against any schema deployed with your application ).

fjb_saper: I think you meant 'XMLNSC parser', not 'XMLNS parser'
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 06, 2012 9:12 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

kimbert wrote:

fjb_saper: I think you meant 'XMLNSC parser', not 'XMLNS parser'

Indeed I did. Edited the previous post to correct the lapsus qwerty.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqxplorer
PostPosted: Mon Jan 09, 2012 11:21 am    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

kimbert wrote:
Short answer: you don't need a message set if you are using XMLNS or XMLNSC. But it's almost always a good idea anyway because it makes the ESQL coding easier.

Longer answer:

The MRM domain always requires a message set - it cannot work without it.

XMLNS can parse an XML document or write a message tree as XML without a message set. In fact, XMLNS cannot use a message set at all. It cannot validate against an XML schema.

XMLNSC can parse an XML document or write a message tree as XML without a message set. Additionally, XMLNSC can validate your XML document or your message tree against a message set ( or in v8, against any schema deployed with your application ).

fjb_saper: I think you meant 'XMLNSC parser', not 'XMLNS parser'


Based on this what I understood is... I do not need to write the ESQL statement to set the message set name in the output properties folder. Is this same for SOAP domain also?

Thanks
mqxplorer
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jan 09, 2012 3:57 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Based on this what I understood is... I do not need to write the ESQL statement to set the message set name in the output properties folder.

That statement leaves me wondering whether you have grasped the main point. Here it is in pseudo-code, just in case:
Code:
IF (you want the output XML to be validated against the xsds in the message set) THEN you must set OutputRoot.Properties.MessageSet ELSE you do not need to set the message set name.
Quote:
Is this same for SOAP domain also?
Yes exactly the same rules apply.
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Mon Jan 09, 2012 5:53 pm    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

kimbert wrote:
Quote:
Based on this what I understood is... I do not need to write the ESQL statement to set the message set name in the output properties folder.

That statement leaves me wondering whether you have grasped the main point. Here it is in pseudo-code, just in case:
Code:
IF (you want the output XML to be validated against the xsds in the message set) THEN you must set OutputRoot.Properties.MessageSet ELSE you do not need to set the message set name.
Quote:
Is this same for SOAP domain also?
Yes exactly the same rules apply.


I forgot to mention the validation part in my response but I got your point. Thanks for the clarification.

This forum makes my life really easy whenever I am struck in understanding something deep about the product.

Thanks
mqxplorer
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 » Parsing or writing of the message
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.