|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
COBOL CopyBook based Message Definition problem |
« View previous topic :: View next topic » |
Author |
Message
|
shalabh1976 |
Posted: Thu Aug 16, 2007 9:41 pm Post subject: COBOL CopyBook based Message Definition problem |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
I have created a definition from a COBOL CopyBook.
I then modified all elements in the copybook to have a default value so that I do not need to create all elements explicitly in ESQL.
My flow is MQInput-->Compute-->MQOutput
Input is XML, Output is MRM based Copybook data.
When I do not set Validate on the MQOutput on the output node as 'None' I get exceptions.
Under the 'None' scenario I get proper output with correct default values.
Without it this is what I get in eventviewer:
Quote: |
Message Validation failure. An element, that has been deemed complete, does not meet the minOccurs constraint.
Element, '56^XTEDTY', has 0 instances on the logical tree, but has been defined or qualified with a minOccurs constraint of 1 within its parent type/element '53^recEDCXT' of index 1.
Adjust the minOccurs constraint downwards and redeploy to the broker or increase the instances of the element in the message itself. |
With default value set the element XTEDTY should be created and is when I change validation to 'None'. What is going on? _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
kimbert |
Posted: Fri Aug 17, 2007 12:42 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
A minOccurs constraint of 1 says that the element must exist in the message tree. If you enable validation, you must satisfy that constraint by ensuring that the element is in the message tree.
A default value provides a value for a missing element ( whether or not it has minOccurs > 0 ). The TDS and CWF output logic will use a default value only when writing fixed-length data in order to ensure that the output bitstream is well-formed.
In v6, none of the WMB parsers use default values when parsing.
One workaround would be to set minOccurs = 0. Another would be to switch off validation ( or do you need it for checking that the values conform to the simple type Value Constraints? ) |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Aug 17, 2007 9:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kimbert wrote: |
A minOccurs constraint of 1 says that the element must exist in the message tree. If you enable validation, you must satisfy that constraint by ensuring that the element is in the message tree.
A default value provides a value for a missing element ( whether or not it has minOccurs > 0 ). The TDS and CWF output logic will use a default value only when writing fixed-length data in order to ensure that the output bitstream is well-formed.
In v6, none of the WMB parsers use default values when parsing.
One workaround would be to set minOccurs = 0. Another would be to switch off validation ( or do you need it for checking that the values conform to the simple type Value Constraints? ) |
The other option that Kimbert did not specify is to create a well formed tree by creating each mandatory element, even if its associated value is NULL. Make sure that you use the key word VALUE = NULL otherwise you might just be removing the element from the tree.
You should then have validation of your outbound message in Cobol MRM format.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|