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 » CONVERTING BLOB TO XML USING STRING MANIPULATION

Post new topic  Reply to topic
 CONVERTING BLOB TO XML USING STRING MANIPULATION « View previous topic :: View next topic » 
Author Message
Kool-Aid
PostPosted: Wed Jul 14, 2004 12:42 pm    Post subject: CONVERTING BLOB TO XML USING STRING MANIPULATION Reply with quote

Novice

Joined: 22 Apr 2004
Posts: 22

Hypothetical Situation:
An application is sending XML Data that contains a return line feed at the beginning of each message using the integrator 2.1. When the XML parser tries to read this message it naturally fails because the first field as the parser sees it is a "." For example the incoming message looks like this:

.<ROOT><FIRSTCHILD><SECONDCHILD>

All I need is to remove the first field and this message will parse. The message needs to look like this in order for it to work:

<ROOT><FIRSTCHILD><SECONDCHILD>.

What I would like to do is read in the data as a BLOB and remove the first field. I would then like to reset its Content and pass it along as XML and continue processing. That is all it should be that simple.

My questions are...
1. Do you need to build a MRM for this task?
2. Is there any feature in which you can do an evaluation on a starting point of data to the EOM (end of message)?
3. Or is there an easier way to do this?
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Jul 14, 2004 12:51 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Please post WMQI related question in WMQI Forum.
[Moving this thread to WMQI Forum]
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Wed Jul 14, 2004 1:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Kool-Aid wrote:

1. Do you need to build a MRM for this task?

No.

Kool-Aid wrote:

2. Is there any feature in which you can do an evaluation on a starting point of data to the EOM (end of message)?

Please explain.

Kool-Aid wrote:

3. Or is there an easier way to do this?

I believe your approach is correct.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Kool-Aid
PostPosted: Tue Jul 20, 2004 6:00 am    Post subject: Reply with quote

Novice

Joined: 22 Apr 2004
Posts: 22

Just to clarify what I was trying to accomplish.
I will recieve a BLOB of data that will vary in length every time. For example it could be 10 bytes or a million. The one thing that will remain a constant is I will always want to remove the first byte. All I want to do is strip off the the first byte and pass the remainder of the message to another node.

Examples

MSG 1 (I want to remove the period)
.abcdefghij

I want to see abcdefghij


MSG 2 (I want to remove the period)
.hijklmno

I want to see hijklmno
Back to top
View user's profile Send private message
JT
PostPosted: Tue Jul 20, 2004 6:17 am    Post subject: Reply with quote

Padawan

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

Code:
DECLARE tempBLOB     BLOB;
    SET tempBLOB  =  SUBSTRING(InputRoot."BLOB"."BLOB" from 2);
CREATE FIRSTCHILD OF OutputRoot Domain('XML') PARSE(tempBLOB);
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Jul 20, 2004 8:16 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Well, if you use XML parser to parse these messages then you will get parsing errors. All you need is this,

Code:

SET OutputRoot."BLOB"."BLOB" = SUBSTRING(InputRoot."BLOB"."BLOB" FROM 2 );

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Michael Dag
PostPosted: Tue Jul 20, 2004 1:28 pm    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

Kool-Aid wrote:
I will recieve a BLOB of data that will vary in length every time. For example it could be 10 bytes or a million. The one thing that will remain a constant is I will always want to remove the first byte. All I want to do is strip off the the first byte and pass the remainder of the message to another node.

Can't you just contact the owner of the application sending the '.' infront of the XML ??? (assuming the . is not 'normal' XML behaviour... )
_________________
Michael



MQSystems Facebook page
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 » CONVERTING BLOB TO XML USING STRING MANIPULATION
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.