|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
mrm-xml |
« View previous topic :: View next topic » |
Author |
Message
|
pepperpaddy |
Posted: Tue Jul 29, 2003 1:04 am Post subject: mrm-xml |
|
|
Novice
Joined: 09 May 2003 Posts: 17
|
hi
I am importing a C structure like the one below
completemsg{
header{
char HField1[4];
char HField2 [6];
}header1;
detail{
char DField1[4];
char DField2 [6];
}detail1;
trailer{
char TField1[4];
char TField2 [6];
}trailer1;
}completemsg1;
I have a type called CompleteMsg which has 3 sections Header, Detail and Trailer with their fields within this. This is within a message set with a CWF. I have set the Detail part and it's members to repeating with min =1 and the max left blank as I will never know how many blank lines there are in the message.
I then went to the compute node
set OutputRoot = InputRoot;
and
DECLARE M INTEGER;
SET M = CARDINALITY("InputBody"."DETAIL1"[]);
DECLARE X INTEGER;
SET X = 1;
WHILE X < M DO
SET "OutputRoot"."MRM"."XMLPPEXACT_DETAIL"[X]."DField1" = "InputBody"."DETAIL1"[X]."DField1";
SET "OutputRoot"."MRM"."XMLPPEXACT_DETAIL"[X]."DField2" = "InputBody"."DETAIL1"[X]."DField2";
END WHILE;
this works if I have only one detail line when I have more than one detail line I get the following message
ParserException BIP5285E: Message Translation Interface Parsing Errors have occurred:
Message Set Name : 'COMPLETEMSG'
Message Set Level : '1'
Message Format : 'CWF'
Message Type Path : 'COMPLETEMSG'
Review further error messages for an indication to the cause of the errors.
2003-07-29 09:03:38.530998 1908 ParserException BIP5171E: Custom Wire Format parsing error
An error occurred while parsing a Custom Wire Format message.
Current message : 'COMPLETEMSG'
Current element : 'COMPLETEMSG'
Path from message root : ''
Offset from start of message : 308
See following errors for more details.
2003-07-29 09:03:38.530998 1908 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).
The repeating line is not picked up before it is parsed, does anyone have any ideas on this? Have I gone about it the right way? Is there a better way ?
thanks |
|
Back to top |
|
 |
Craig B |
Posted: Tue Jul 29, 2003 7:10 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
In your update you say that you have not set a maxOccurs in your connection tab. This would have led to having a repeat Count of 1 or no repeat count value on the CWF physical layer tab. The information on the CWF tab is actually used by the parser to perform the actual parsing, and in this case, if it is 1, or blank, then it will only parse one instance. Since it will only parse 1 repetition, the remainder of the bitstream will be seen as extraneous and hence the BIP5288E is generated.
Unfortunately what you have tried to do with MRM-CWF parser is not possible. It is not possible to have an unspecified number of repetitions on the MRM-CWF physical format. Since it is a fixed format parser it needs to know the number of repetitions either as a hardcoded number, or using a preceeding field that specifies the number.
The reason for this is especially evident in your example, where you wanted the detail record to repeat. In this case, how would the MRM-CWF parser know where the detail repetitions end and the trailer record starts? A human reading it maybe able to see, but the MRM-CWF parser just keeps taking the next set of bytes as instructed by the next element. This means that if unbounded repetitions are allowed then it would keep parsing the detail records and never switch to the trailer record.
There is an argument that the MRM-CWF should be able to cope with this if the element is the last in the message and it is a simple element, then there should be a way of repeating until the end of the bitstream, but as far as I am aware this is not possible either. _________________ Regards
Craig |
|
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
|
|
|
|