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 » Mapping Node with custom XPath

Post new topic  Reply to topic
 Mapping Node with custom XPath « View previous topic :: View next topic » 
Author Message
Maxicat
PostPosted: Tue May 14, 2013 3:27 pm    Post subject: Mapping Node with custom XPath Reply with quote

Newbie

Joined: 14 May 2013
Posts: 5

Hi,

I'm trying to build a simple flow that takes a BLOB, treats it as string, replaces parts of the string and puts it back to a queue. I'm using v8.0.0.2.

My flow looks like:
MQInput -> Mapping -> MQOutput

The Mapping Node uses the following custom XPath expression on the BLOB/value field:
fn:replace( fn:string( $value1 ), "a", "*" )

The flow runs fine but the message payload isn't changed at all.
What did I miss?

Another annoying problem is that when an exception occurs in the Mapping Node, the debugger isn't very helpful and just says 'source not found'.

-S.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue May 14, 2013 10:06 pm    Post subject: Re: Mapping Node with custom XPath Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Maxicat wrote:


Another annoying problem is that when an exception occurs in the Mapping Node, the debugger isn't very helpful and just says 'source not found'.

-S.


All the more reason to get familiar with using UserTrace. You might be pleasantly surprised at the help it will give you.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Maxicat
PostPosted: Wed May 15, 2013 12:32 am    Post subject: Reply with quote

Newbie

Joined: 14 May 2013
Posts: 5

Thanks. I wonder if the toolkit has a view that displays the User Trace? it's counter productive going back and forth between the toolkit and the command line.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 15, 2013 4:28 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Maxicat wrote:
it's counter productive going back and forth between the toolkit and the command line.


No it isn't.

And no it doesn't.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mgk
PostPosted: Wed May 15, 2013 5:38 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi, assuming you choose the BLOB schema for your map Input and Output, this XPath should work for you:

xs:hexBinary(replace(string($value), "61", "2a"))

(where "61" and "2a" are the ASCII codes for "a" and "*" respectively).

Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Maxicat
PostPosted: Wed May 15, 2013 6:44 am    Post subject: Reply with quote

Newbie

Joined: 14 May 2013
Posts: 5

Thanks

Is it possible to translate this literal char representation to a human-readable string? i.e. fn:replace( fn:blob_to_string( $value1 ), "a", "*" )
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed May 15, 2013 7:12 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Maxicat wrote:
Thanks

Is it possible to translate this literal char representation to a human-readable string? i.e. fn:replace( fn:blob_to_string( $value1 ), "a", "*" )


What does the 'BLOB' look like inside your flow?
Put a trace node set to

${Root.BLOB}

and look for yourself. Then ask yourself that question again.

It would have only take a minute or two to do this. A lot quicker than asking a question that you could have answered for yourself. The side effect of finding out for yourself is that you will remember it far longer than you do if you are simply told the answer.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed May 15, 2013 7:26 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I wonder if the toolkit has a view that displays the User Trace?
No it doesn't, but I agree that it would be a useful feature. Vitor's point ( at risk of putting words into his mouth ) is this: the effort of taking a user trace is sometimes repaid many times over. Even if it's a bit of a hassle.
I'm not saying that other debugging techniques should be discarded - but there are times when you need to know *why* things have happened, and the debugger can't tell you.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 15, 2013 7:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kimbert wrote:
at risk of putting words into his mouth


If anyone puts words in my mouth, you're welcome to.

kimbert wrote:
the effort of taking a user trace is sometimes repaid many times over. Even if it's a bit of a hassle.


Quite.

It's also possible to eliminate much of the "hassle" with scripts, desktop shortcuts and other methods.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Maxicat
PostPosted: Thu May 16, 2013 1:09 pm    Post subject: Reply with quote

Newbie

Joined: 14 May 2013
Posts: 5

FYI.

Here's my little Ant script to control the User Trace. Together with the freely available Eclipse LogViewer plugin, tracing is a bit more newbie-friendly. Windows-only version for now.

See https://github.com/j4zzcat/Utils/blob/master/wmb/user-trace.ant
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 » Mapping Node with custom XPath
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.