|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Optional local element in a message |
« View previous topic :: View next topic » |
Author |
Message
|
mquser1 |
Posted: Mon Jul 12, 2004 10:01 am Post subject: Optional local element in a message |
|
|
Novice
Joined: 03 Jun 2004 Posts: 23
|
Hi all,
I am running into the following error, when I make the last local element of my message, optional.
========================================
RecoverableException BIP2230E: Error detected whilst processing a message in node 'CRAuthGetAndRoute.Trace'.
The message broker detected an error whilst processing a message in node 'CRAuthGetAndRoute.Trace'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error.
2004-07-12 12:43:21.823205 599 ParserException BIP5285E: Message Translation Interface Parsing Errors have occurred:
Message Set Name : 'CreditCardRequestMsgSet'
Message Set Level : '1'
Message Format : 'CWF'
Message Type Path : 'CreditCardMessage'
Review further error messages for an indication to the cause of the errors.
2004-07-12 12:43:21.823249 599 ParserException BIP5171E: Custom Wire Format parsing error
An error occurred while parsing a Custom Wire Format message.
Current message : 'CreditCardMessage'
Current element : 'CreditCardMessage'
Path from message root : ''
Offset from start of message : 424
See following errors for more details.
2004-07-12 12:43:21.823278 599 ParserException BIP5288E: MRM parsing error. Message bit stream larger than expected.
The bit stream of the message being parsed by the MRM parser is larger than expected for a message of this message type.
The message bit stream has been incorrectly constructed, or the logical model is incorrect.
Ensure that the message is correctly packaged.
Ensure that the message properties are correct.
Ensure that the logical model for this message type is complete (the message set and message type should be quoted in previous messages).
========================================
I am making the element optional, by setting Min occurs to 0 and Max Occurs to 1. Is there anything more that I need to do to make a local element optional, besides this. Please advise. I am on wbimb 5.0, csd02.
Thanks much. |
|
Back to top |
|
 |
mquser1 |
Posted: Mon Jul 12, 2004 1:56 pm Post subject: |
|
|
Novice
Joined: 03 Jun 2004 Posts: 23
|
I have figured the following with respect to CWF messages.
CWF Messages cannot have optional elements. They have to have all the elements.
While it is not possible to make a field optional while parsing in custom wire format messages, It is possible to make a field optional while constructing a cwf message (to be sent to output), by setting the default value property of that field.
Can you please confirm if this is indeed the case?
If this is the case, then how would one handle messages coming in, that could have optional fields? Do we have to use the blob parser and then substring out each element individually and validate?
Would highly appreciate any comments on this. Thank you. |
|
Back to top |
|
 |
kirani |
Posted: Mon Jul 12, 2004 4:31 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
You cannot set an element to optional in MRM-CWF.
mquser1 wrote: |
Can you please confirm if this is indeed the case?
|
Yes.
mquser1 wrote: |
If this is the case, then how would one handle messages coming in, that could have optional fields? Do we have to use the blob parser and then substring out each element individually and validate?
|
Try to model your message in TDS wire format.
Can you post an example of your input message? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
kimbert |
Posted: Tue Jul 13, 2004 2:45 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
In general, CWF cannot parse optional fields, because it is a fixed-length format. In your case, the optional element is at the end, so it is theoretically parseable. However, CWF does not allow this scenario.
Good news, though. You certainly don't need to do all the parsing in ESQL.
First, create two message definitions, one which contains the optional field, and one which does not. Parse the message as a BLOB. In the compute node, check the length of the bitstream and then re-parse the message against the appropriate message definition. Doing it this way means that you can still get all the hard work done by the MRM parser. |
|
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
|
|
|
|