Author |
Message
|
kimbert |
Posted: Tue Sep 08, 2009 1:48 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
There are plenty of examples of how to use ASBITSTREAM with the correct parameters. Doesn't matter whether the other threads are dealing with a problem identical to yours. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Sep 08, 2009 1:55 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
Errrr....you might want to check the documentation for ASBITSTREAM once again. ASBITSTREAM produces a BLOB. So why would you want to CAST the result to BLOB?
Don't call CopyEntireMessage() and then delete the MRM tree - that's burning CPU doing a redundant copy followed by a redundant delete. Better to avoid copying InputRoot.MRM to OutputRoot in the first place. |
|
Back to top |
|
 |
nize |
Posted: Tue Sep 08, 2009 2:39 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
|
Back to top |
|
 |
kimbert |
Posted: Tue Sep 08, 2009 2:57 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
Thanks for the tip. I've submitted an update to correct that. |
|
Back to top |
|
 |
nize |
Posted: Tue Sep 08, 2009 3:42 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
I use this code
Code: |
--DECLARE options INTEGER FolderBitStream; --BITOR(FolderBitStream);
CALL CopyEntireMessage();
SET Environment.var.credR.credRRec = OutputRoot.MRM.credRRec[2];
DECLARE testBlob BLOB CAST (
ASBITSTREAM(
OutputRoot.MRM.credRRec[2]
--OPTIONS options
ENCODING 273
CCSID 1208
SET 'HLMCKR4002001'
TYPE 'credR/credRRec'
FORMAT 'CWF1'
)
AS BLOB);
SET OutputRoot.MRM = NULL;
SET OutputRoot."BLOB"."BLOB" = testBlob; |
but still the resulting testBlob contains the data which coudl be found in OutputRoot.MRM.credRRec[1]. I dont figure out why...
note: I have learned that the extra CAST and the extra message copy are not required - they are only there until I have got the logic figured out. |
|
Back to top |
|
 |
nize |
Posted: Tue Sep 08, 2009 3:58 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
kimbert, I found a post you left here
http://www.mqseries.net/phpBB2/viewtopic.php?t=21435
Am I right that the addressing I am trying to do with
Code: |
TYPE 'credR/credRRec' |
only works if you use FolderBitStream, which in turn doesnt work with MRM?
I thought I would not need to go into the message editor to construct an additional message only containing credRRec. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Sep 08, 2009 5:13 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
I don't see any post by me on that thread.
The MRM parser supports FolderBitStream mode - there must be another explanation. |
|
Back to top |
|
 |
nize |
Posted: Tue Sep 08, 2009 5:33 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
|
Back to top |
|
 |
kimbert |
Posted: Tue Sep 08, 2009 5:41 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
Yes, it depends on which runtime you are using.
I suggest that you take the hit and create a separate message definition for the CredRec field. Or else upgrade to v6.1. |
|
Back to top |
|
 |
nize |
Posted: Tue Sep 08, 2009 5:51 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
ok, thanks for all help
i am diving into the message modeling djungle. |
|
Back to top |
|
 |
nize |
Posted: Wed Sep 09, 2009 4:51 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
I get the following user trace:
Code: |
2009-09-09 14:35:47.659076 2090 ParserException BIP5286E: Message Translation Interface Writing Errors have occurred:
Message Set Name : 'SCFL230_credR_MsgSet'
Message Set Level : '1'
Message Format : 'CWF1'
Message Type Path : 'credRRec'
Review further error messages for an indication to the cause of the errors.
2009-09-09 14:35:47.659088 2090 ParserException BIP5167E: Custom Wire Format error while parsing/writing message 'credRRec'.
2009-09-09 14:35:47.659095 2090 ParserException BIP5350E: Custom Wire Format writing error. While writing the message quoted above, the CWF writer encountered an error.
The error occurred during or after the writing of element '/credRRec/credRRec'.
Check that you have built the message correctly.
See following messages for more details.
2009-09-09 14:35:47.659103 2090 ParserException BIP5463E: Custom Wire Format output error
An error has occurred during the output of an element which is missing from the message tree.
The policy for the output of missing elements for the current message set is : 'Use Null Value'.
However, no Null Value has been specified for this element.
Current Message : 'credRRec'
Current Element : '118^nationCode'
One of the following actions may resolve the problem:
Check that the correct 'Policy for Missing Elements' has been specified for your message set.
Ensure that an appropriate null value has been specified for the element's 'Encoding Null Value' property.
Ensure that this element is present in the message tree.
|
This is the ESQL code (its only for testning):
Code: |
SET Environment.var.credRRec = InputBody.credRRec[2];
DECLARE testBlob BLOB CAST (
ASBITSTREAM(
--OutputRoot.MRM.credRRec[2]
--Environment.var.credR.credRRec
InputBody.credRRec[2]
--OutputRoot.XMLNS.tns:credR.credRRec[2]
--OPTIONS options
ENCODING 273
CCSID 1208
SET 'HLMCKR4002001'
TYPE 'credRRec'
FORMAT 'CWF1'
)
AS BLOB);
SET OutputRoot.MRM = NULL;
--SET OutputRoot.XMLNS = NULL;
SET OutputRoot."BLOB"."BLOB" = testBlob;
|
This is a part of the test message:
Code: |
<credRRec>
<nationCode>SE</nationCode>
<custNo>40215</custNo>
... elements omitted ...
</credRRec>
<credRRec>
<nationCode>SE</nationCode>
<custNo>40215</custNo>
... elements omitted ...
|
This is a part of the message definition file mxsd:
Code: |
<xs:complexType name="credRRec">
<xs:sequence>
<xs:element name="nationCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
... elements omitted ...
<xs:element name="credRRec" type="tns:credRRec">
<xs:annotation>
<xs:appinfo source="WMQI_APPINFO">
<MRMessage messageDefinition="/credRRec;XSDElementDeclaration=1/"/>
</xs:appinfo>
</xs:annotation>
</xs:element>
|
I am concerned with the line '/credRRec/credRRec' in the user trace.
Do you see what is wrong? |
|
Back to top |
|
 |
nize |
Posted: Wed Sep 09, 2009 5:39 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
I found another part in the user trace:
Code: |
ParserException BIP5371E: Message Validation failure. Invalid member for content validation 'Closed'
Element, credRRec, is either not defined as a member of its parent complex type or group, or has been created out of order in the logical tree, for a composition of 'Ordered Set' or 'Sequence'. The parent complex type or group has content validation of 'Closed'. The parent element is [...]:credR.
Modify the message set or messageflow and redeploy to the broker or modify the input message and resubmit to the broker.
|
|
|
Back to top |
|
 |
nize |
Posted: Wed Sep 09, 2009 7:22 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
I have noticed something rather interesting
What is confusing me is that ASBITSTREAM (as in the code above) doesnt use the field reference I inserted as argument, but instead it looks only in InputRoot.MRM (i.e. InputBody). Hopefully this insight (if it is correct) will help me advance... |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 10, 2009 1:41 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
What does your CredRec message look like? I suspect that you have created a message called 'CredRec containing another element called 'CredRec'. Correct? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 10, 2009 3:09 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20767 Location: LI,NY
|
kimbert wrote: |
I don't see any post by me on that thread.
The MRM parser supports FolderBitStream mode - there must be another explanation. |
Are you sure? Which version? Which type of MRM parser XML, CWF, TDS?
You can get around it by defining your folder as a message... in the message set...
This is what the documentation says in 6.0: (same wording in 6.1)
Quote: |
Some parsers also support another mode, FolderBitStream, which generates a meaningful bit stream for any subtree, provided that the field that is pointed to represents a folder. |
See http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak05510_.htm
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
|