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 » Parsing XML/Flat File.

Post new topic  Reply to topic
 Parsing XML/Flat File. « View previous topic :: View next topic » 
Author Message
venky
PostPosted: Mon Aug 15, 2005 7:37 am    Post subject: Parsing XML/Flat File. Reply with quote

Master

Joined: 08 Jul 2003
Posts: 205

Hello All,

Here is my issue scenario:
The input is a XML message, one of the tags in the XML message contains the Flat File Data ( SNF 856 ).
The Output message sent to the target should be only the Flat File data extracted from input message and sent to Output queue.

Please let me know if this is possible. Any code examples will be great. I tried, but was unsuccessful.

Thanks in advance,
Venky
--
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Aug 15, 2005 7:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

This is extremely basic use of the product.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JT
PostPosted: Mon Aug 15, 2005 9:16 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Post your ESQL code.
Back to top
View user's profile Send private message
venky
PostPosted: Mon Aug 15, 2005 6:05 pm    Post subject: Reply with quote

Master

Joined: 08 Jul 2003
Posts: 205

JT,

Here is my ESQL.

CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
--CALL CopyMessageHeaders();
CALL CopyEntireMessage();

SET OutputRoot.XML = NULL;

SET OutputRoot."BLOB"."BLOB" = BITSTREAM(InputRoot.XML.CustomerMsg.DataArea.MsgData);

RETURN TRUE;
END;

Thanks,
Venky
--
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Aug 15, 2005 6:46 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
CALL CopyEntireMessage();

Why are you copying the complete message if you are going to create a new message body.
Quote:
BITSTREAM

This is deprecated. Look into using ASBITSTREAM.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Wed Aug 17, 2005 2:55 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

Your code should be something like this:
Code:

CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
--CALL CopyEntireMessage();

SET OutputRoot.XML = NULL;

SET OutputRoot."BLOB"."BLOB" = ASBITSTREAM(InputRoot.XML.CustomerMsg.DataArea.MsgData);

RETURN TRUE;
END;

I dont have toolkit right now with me, so couldn't test the code...
but dig the esql pdf for more info on ASBITSTREAM function.
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Wed Aug 17, 2005 3:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Actually, ASBITSTREAM is only necessary if venky needs to take a subtree from the input message as a single blob entity.

venky wrote:
The input is a XML message, one of the tags in the XML message contains the Flat File Data ( SNF 856 ).

This sounds like the VALUE of some tag contains the ENTIRE flatfile - so ASBITSTREAM is not necessary, and will do something wrong.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Wed Aug 17, 2005 3:43 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

So do you mean to say that:
Either he can just copy the value of that field from InputRoot to OutputRoot:
Code:

CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
--CALL CopyEntireMessage();

CREATE FIELD OutputRoot.XML.Data VALUE InputRoot.XML.CustomerMsg.DataArea.MsgData;

RETURN TRUE;
END;

Or if he wants the output message to be blob, he can use:
Code:

CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
--CALL CopyEntireMessage();

CREATE FIELD OutputRoot.BLOB.BLOB VALUE ASBITSTREAM(InputRoot.XML.CustomerMsg.DataArea.MsgData);

RETURN TRUE;
END;

Or he can use first code in the list and then use RCD to convert it to BLOB..!!
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Wed Aug 17, 2005 3:47 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Yeah, except I'd use SET instead of CREATE field - not for any good reason, just from habit.

Again, though, this is the most basic use of the product there is. This is lesson 1 on day 1 of any message flow training - "How do I make a different message out of the input message?". Some of the IBM classes will start with stuff like "This is the toolbox, this is a message flow, this is how you connect nodes...".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Wed Aug 17, 2005 3:51 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

I agree with jefflowry..
really, this is THE BASIC use of message broker...
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Parsing XML/Flat File.
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.