Author |
Message
|
delerium |
Posted: Thu Jan 18, 2007 12:45 pm Post subject: Return single Output value from XML Input |
|
|
Novice
Joined: 27 Nov 2006 Posts: 13
|
Hi,
Basically need obtain a single Output value from my Xml Input. I have the follow sentence in my ESQL code, but I can´t send the value of element Name to the OutputRoot:
SET OutputRoot= InputRoot.XML.Header.Name;
Thanxs |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 18, 2007 12:47 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What does "single output value" mean?
What do you need to have in the output message?
A single string? That would be a BLOB domain message. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
special_agent_Queue |
Posted: Thu Jan 18, 2007 12:50 pm Post subject: |
|
|
 Centurion
Joined: 27 Jul 2006 Posts: 102
|
You cannot do that. At least not in that way. Your best bet would be blob. This would be done like OutputRoot.BLOB.BLOB. That way, you can get the single value, and the receiving app would see just the MQMD and that value. |
|
Back to top |
|
 |
delerium |
Posted: Thu Jan 18, 2007 1:03 pm Post subject: |
|
|
Novice
Joined: 27 Nov 2006 Posts: 13
|
Sorry, I mean String when I said "single output value" |
|
Back to top |
|
 |
pathipati |
Posted: Thu Jan 18, 2007 1:38 pm Post subject: |
|
|
Master
Joined: 03 Mar 2006 Posts: 296
|
I never did it, but I guess storing all the elements in to one string and returning that string may do it.
DECLARE s CHARACTER;
SET s = InputRoot.XML.String1; |
|
Back to top |
|
 |
sarat |
Posted: Thu Jan 18, 2007 9:20 pm Post subject: |
|
|
 Centurion
Joined: 29 Jun 2005 Posts: 136 Location: India
|
wat's the output format u want?
If it's BLOB then
as special_agent_Queue suggests
Quote: |
OutputRoot.BLOB.BLOB. |
otherwise you should have minimum one root tag!! _________________ With Regards,
Sarat. |
|
Back to top |
|
 |
delerium |
Posted: Fri Jan 19, 2007 3:56 am Post subject: |
|
|
Novice
Joined: 27 Nov 2006 Posts: 13
|
I need return a String to output
XML(Input)-------->String(Output) |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 19, 2007 4:18 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
That's a BLOB domain message.
Please get training on WMB. It's a complicated product and not easy to learn on it's own. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
delerium |
Posted: Fri Jan 19, 2007 6:27 am Post subject: |
|
|
Novice
Joined: 27 Nov 2006 Posts: 13
|
Thanks for your time and answers, finally I need the code (please it´s urgent) what converting XML Input to BLOB and returning a String from this BLOB to the Output. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 19, 2007 6:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You've got the code in front of you.
We're not getting paid to write the code. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
delerium |
Posted: Fri Jan 19, 2007 8:32 am Post subject: |
|
|
Novice
Joined: 27 Nov 2006 Posts: 13
|
OK,
I have a code, now I receive the Output message but the message is empty |
|
Back to top |
|
 |
special_agent_Queue |
Posted: Fri Jan 19, 2007 9:17 am Post subject: |
|
|
 Centurion
Joined: 27 Jul 2006 Posts: 102
|
What is your code? And what is the input message? |
|
Back to top |
|
 |
delerium |
Posted: Fri Jan 19, 2007 9:58 am Post subject: |
|
|
Novice
Joined: 27 Nov 2006 Posts: 13
|
The code:
CREATE COMPUTE MODULE EXTRACT_DATA_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
--CALL CopyEntireMessage();
SET OutputRoot.Properties.MessageSet = 'DMRQ2K4002001';
SET OutputRoot.Properties.MessageType = 'Template';
SET OutputRoot.Properties.MessageFormat = 'CWF';
SET OutputRoot.MRM.NAME= InputRoot.XML.MWAS.Name;
SET OutputDestinationList.Destination.MQDestinationList[1].DestinationData.queueName = InputRoot.XML.MWAS.Hdr.Service||'2.IN';
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
Thanks |
|
Back to top |
|
 |
delerium |
Posted: Fri Jan 19, 2007 10:03 am Post subject: |
|
|
Novice
Joined: 27 Nov 2006 Posts: 13
|
Now I have the follow error:
No Physical Format layer with Wire Format Identifier 'CWF' in message set. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 19, 2007 10:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Is your physical format named 'CWF1'? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|