ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Return single Output value from XML Input

Post new topic  Reply to topic
 Return single Output value from XML Input « View previous topic :: View next topic » 
Author Message
delerium
PostPosted: Thu Jan 18, 2007 12:45 pm    Post subject: Return single Output value from XML Input Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Jan 18, 2007 12:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
special_agent_Queue
PostPosted: Thu Jan 18, 2007 12:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
delerium
PostPosted: Thu Jan 18, 2007 1:03 pm    Post subject: Reply with quote

Novice

Joined: 27 Nov 2006
Posts: 13

Sorry, I mean String when I said "single output value"
Back to top
View user's profile Send private message
pathipati
PostPosted: Thu Jan 18, 2007 1:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
sarat
PostPosted: Thu Jan 18, 2007 9:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
delerium
PostPosted: Fri Jan 19, 2007 3:56 am    Post subject: Reply with quote

Novice

Joined: 27 Nov 2006
Posts: 13

I need return a String to output

XML(Input)-------->String(Output)
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 19, 2007 4:18 am    Post subject: Reply with quote

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
View user's profile Send private message
delerium
PostPosted: Fri Jan 19, 2007 6:27 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 19, 2007 6:28 am    Post subject: Reply with quote

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
View user's profile Send private message
delerium
PostPosted: Fri Jan 19, 2007 8:32 am    Post subject: Reply with quote

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
View user's profile Send private message
special_agent_Queue
PostPosted: Fri Jan 19, 2007 9:17 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

What is your code? And what is the input message?
Back to top
View user's profile Send private message
delerium
PostPosted: Fri Jan 19, 2007 9:58 am    Post subject: Reply with quote

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
View user's profile Send private message
delerium
PostPosted: Fri Jan 19, 2007 10:03 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 19, 2007 10:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Return single Output value from XML Input
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.