|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Compute Node Input/Output XML. |
« View previous topic :: View next topic » |
Author |
Message
|
venky |
Posted: Tue Sep 09, 2003 8:17 am Post subject: Compute Node Input/Output XML. |
|
|
 Master
Joined: 08 Jul 2003 Posts: 205
|
Hi All,
I have a problem with compute node.
Domain = XML.
Input = XML.
________________________________
My input is this:
<?xml version="1.0" encoding="UTF-8"?>
<Invoice>
<Purchases>
<Item>
<Quantity>10</Quantity>
</Item>
<Item>
<Quantity>200</Quantity>
</Item>
</Purchases>
</Invoice>
____________________________________
I want my Output to look like this.
<?xml version="1.0" encoding="UTF-8"?>
<Output>
<Items>
<Quantity>10</Quantity>
<Quantity>200</Quantity>
</Items>
</Output>
____________________________________
My code in Compute would be :
DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.XML.(XML.XmlDecl) = '';
SET OutputRoot.XML.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XML.(XML.XmlDecl).(XML."Encoding") = 'UTF-8';
SET OutputRoot.XML.(XML.XmlDecl).(XML.Standalone) = 'no';
SET OutputRoot.XML.Output.Items.Quantity[1] = InputRoot.XML.Invoices.Purchases.Item[1].Quantity;
SET OutputRoot.XML.Output.Items.Quantity[2] = InputRoot.XML.Invoices.Purchases.Item[2].Quantity;
_____________________________________________________
Other settings :
My Input Node domain is XML.
but it doesnt seem to work.
Please suggest.
thanks,
Venky. |
|
Back to top |
|
 |
Craig B |
Posted: Tue Sep 09, 2003 8:39 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
In your information you have specified a root tag of Invoice for your input message, yet in your field references you have specified InputRoot.XML.Invoices.Purchases.Item[1].Quantity. So you are referencing a field called Invoices which does not exist. This will assign NULL to your output and not create your output fields in the output XML tree. You need to change these so that they reference Invoice, not Invoices. _________________ Regards
Craig |
|
Back to top |
|
 |
venky |
Posted: Tue Sep 09, 2003 10:55 am Post subject: |
|
|
 Master
Joined: 08 Jul 2003 Posts: 205
|
Hi,
It was supposed to be Invoice, typing error.
sorry,
venky. |
|
Back to top |
|
 |
Craig B |
Posted: Tue Sep 09, 2003 11:03 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
So are you saying there was a typo in your flow and your error has been corrected, or are you saying there is a typo in this thread such that in your compute node you ESQL reads :
Code: |
SET OutputRoot.XML.Output.Items.Quantity[1] = InputRoot.XML.Invoice.Purchases.Item[1].Quantity;
SET OutputRoot.XML.Output.Items.Quantity[2] = InputRoot.XML.Invoice.Purchases.Item[2].Quantity;
|
If your error is still persisting, what output do you get? Do you get a BIP error indicating there was a problem with your output message, or do you get an output message that is not of the format you expect?? _________________ Regards
Craig |
|
Back to top |
|
 |
venky |
Posted: Tue Sep 09, 2003 11:37 am Post subject: |
|
|
 Master
Joined: 08 Jul 2003 Posts: 205
|
Hi,
That was a typo in the Forums. when I typed in the ESQL it was correctly typed. So I have the problem yet.
Errors:
I don't get a output to the expected output queue.
I get the message to the Failure queue.
what could be the problem.
thanks,
Venky. |
|
Back to top |
|
 |
Craig B |
Posted: Tue Sep 09, 2003 12:08 pm Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
I ran your scenario on my WMQI V2.1 CSD05 environment and the flow was successful and wrote out the output message you are expecting. What Version and CSD level of the product are you using?
Do you get any errors in your Local error log as to what errors are occuring? You could capture a user level debug trace of the flow which will show any errors that are occuring in on your system. Alternatively, my guess is that the error is occuring in the MQOutput node, and so you could wire the fail terminal of this node, and capture the ${ExceptionList} to a Trace node file. If currently have the Failre terminal of the MQInput node wired, then this will not show you your error.
Ultimately, for this case, we need to see what error you are getting, and then determine why you are getting this error when I dont for your scenario. _________________ 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
|
|
|
|