Author |
Message
|
angka |
Posted: Mon Jul 31, 2006 1:39 am Post subject: Length of Data using Broker |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi all,
How to get the data length after i set the OutputRoot.XML...... Is there a parameter in mq which counts for us? Thanks
Rgds. |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Jul 31, 2006 2:11 am Post subject: Re: Length of Data using Broker |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi angka,
angka wrote: |
How to get the data length after i set the OutputRoot.XML...... Is there a parameter in mq which counts for us? |
In MB use LENGTH, In MQ use getMessageLength()
Is this what u wanted ?
Regards. |
|
Back to top |
|
 |
angka |
Posted: Mon Jul 31, 2006 2:16 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi elvis_gn,
Ya but thought it can only count OutputRoot.blob.blob. btw is there any additional value tt i need to minus off? thanks.. |
|
Back to top |
|
 |
angka |
Posted: Mon Jul 31, 2006 2:58 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
Is there a way to count the whole OutputRoot.XML tree rather den counting each child eg LENGTH(OutputRoot.XML.Message.a)? thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jul 31, 2006 7:14 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can use ASBITSTREAM to flatten the data into a bitstream (a BLOB) and then do length of that.
Otherwise, you can't really even get this by walking the tree - because you won't get tag names in your lengths. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
angka |
Posted: Tue Aug 01, 2006 1:31 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
|
Back to top |
|
 |
angka |
Posted: Tue Sep 26, 2006 12:37 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
How do I calculate the data length for OutputRoot.MRM?
I tried using
SET Datalength = ASBITSTREAM(OutputRoot.MRM SET 'adf' TYPE 'fdfd' FORMAT 'CWF1');
Using this way, I only get the data length of the Custom Wired Format but not those MRM tags..
Thanks |
|
Back to top |
|
 |
vinbud117 |
Posted: Tue Sep 26, 2006 12:52 am Post subject: |
|
|
Acolyte
Joined: 22 Jul 2005 Posts: 61
|
ASBITSTREAM gives the BLOB form of the input. CWF does not contain the tags, tht is y u get the length of only the data... |
|
Back to top |
|
 |
kimbert |
Posted: Tue Sep 26, 2006 5:32 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
There is only one reliable way to find the length of an output message. The method is the same whatever the domain.
1. Serialialize the message using ASBITSTREAM and save the result in a BLOB.
2. Get the length of the BLOB using the LENGTH function.
For CWF, it might be possible to do it by walking the tree and adding up the lengths. That will work sometimes, but it depends on the trimming and padding options on the individual fields. So if you want your message flow to be independent of your message set, I don't recommend that approach. |
|
Back to top |
|
 |
angka |
Posted: Tue Sep 26, 2006 6:06 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
My input message body is of CWF then in my flow I parse it to MRM and after parsing, I try the following codes:
1)SET OUTPUT_DATA = ASBITSTREAM(OutputRoot.MRM);
2)SET DATA_LENGTH = LENGTH(OUTPUT_DATA);
after my 1st statement, I got the error "Invalid Wire format retreived". Since the flow has logically convert the CWF message to MRM why I can't convert it to BITSTREAM.
I tried this
1)SET OUTPUT_DATA = ASBITSTREAM(OutputRoot.XML);
2)SET DATA_LENGTH = LENGTH(OUTPUT_DATA);
it works for XML..
Kimbert: ya i want my message flow to be independent of my message set. Thanks |
|
Back to top |
|
 |
kimbert |
Posted: Wed Sep 27, 2006 12:25 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I try the following codes:
1)SET OUTPUT_DATA = ASBITSTREAM(OutputRoot.MRM); |
So...how were you expecting the MRM parser to find the correct message set? Please search for ASBITSTREAM in this forum if you don't understand that question. |
|
Back to top |
|
 |
|