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 » How to format XML in user trace (WMB 6.1)

Post new topic  Reply to topic
 How to format XML in user trace (WMB 6.1) « View previous topic :: View next topic » 
Author Message
yortch
PostPosted: Fri Aug 14, 2009 1:40 pm    Post subject: How to format XML in user trace (WMB 6.1) Reply with quote

Apprentice

Joined: 30 Aug 2004
Posts: 34

I have a user trace node that I'm using to log XML data, however the output contains characters escaped in hexadecimal:

Code:
2009-08-14 17:30:40.869253 Request Received: ( ['xmlnsc' : 0xaf85d8]
  (0x01000000:Folder)urn:enterprise.soap.sforce.com:login = (
    (0x03000000:PCDataField)urn:enterprise.soap.test.com:username = 'username@domain.con' (CHARACTER)
    (0x03000000:PCDataField)urn:enterprise.soap.sforce.com:password = 'mypwd' (CHARACTER)
  )
)


I'd like the output to contain valid XML. This is the pattern that I'm using:
Quote:
${CURRENT_TIMESTAMP} Request Received: ${Root.XMLNSC}


Is there a "format" function I can use? Or a different property I should use?

Thanks in advanced!
Back to top
View user's profile Send private message
fschofer
PostPosted: Fri Aug 14, 2009 3:50 pm    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Hi,
the hexadecimal value describes the type of the data which you are seeing in the trace like Element, Attribute and so on which is useful for debugging purposes, see
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/as08560_.htm
and
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac67192_.htm

If you want to log the XML one-to-one write it out to a queue,a file or a database.

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Sat Aug 15, 2009 3:05 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I think you are getting confused. This:
Code:
['xmlnsc' : 0xaf85d8]
is telling you the name of the parser and its unique identifier. The '0xaf85d8' is not 'characters escaped in hexadecimal'.

Also, the Trace ( not 'User Trace' ) node is for showing you the contents of the message tree. The message tree is not XML, even if it was created by an XML parser. It is a logical representation of your message.
If you want to see what your message tree would look like if it was written by the XMLNSC parser, then use ASBITSTREAM to turn the message tree into an XML bit stream. You can even trace the result if you want to.

But...
Quote:
I have a user trace node that I'm using to log XML data
Don't use the Trace node for logging - it's a diagnostic tool, and is meant to help you debug your message flows. Sorry if that was what you meant by 'log'.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sat Aug 15, 2009 11:11 pm    Post subject: Reply with quote

Jedi Council

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

kimbert wrote:
Don't use the Trace node for logging


sigh!

I've lost count of the number of production systems I have come upon that do that very thing. Many have been around since V2.1 days (and one from 2.0.1). I do try to persuade them to change this but almost without exception I'm doomed to failure.
In these days of Email & FileOutput nodes, is it daft to rely on the output to trace files for error detection. You won't belive some of the 'trick' that some sites go through to 'grep' the files on a periodic basis to detect errors.

'If it ain't broke then don't fix it' is probably worse here than 'defective by design'

(now where is the 'head in sand' Emoticon when you need it?)
_________________
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
yortch
PostPosted: Mon Aug 17, 2009 5:59 am    Post subject: Reply with quote

Apprentice

Joined: 30 Aug 2004
Posts: 34

kimbert wrote:
Don't use the Trace node for logging - it's a diagnostic tool, and is meant to help you debug your message flows. Sorry if that was what you meant by 'log'.


Thanks for the feedback, this is very helpful. What would you recommend to use for logging? Ideally I would use the log4j supportPac (IAM3) but it may not get approved within my project. As a workaround I was evaluating the use of the trace node with a file destination. I need something that I can disable (ideally by log level: debug, warn, error) at production, i.e. similar to what most logging frameworks (e.g. log4j) provide. It should be something convenient to invoke, ideally through either a node or from ESQL. In some cases we will need to log XML, e.g. the SOAP request sent to a web service.
Back to top
View user's profile Send private message
yortch
PostPosted: Tue Aug 25, 2009 9:40 am    Post subject: Reply with quote

Apprentice

Joined: 30 Aug 2004
Posts: 34

Quote:
If you want to see what your message tree would look like if it was written by the XMLNSC parser, then use ASBITSTREAM to turn the message tree into an XML bit stream. You can even trace the result if you want to.

This is exactly what I need. I tried the ASBITSTREAM function, it seems I now need a way of converting the stream of bytes back into their character representation, which hopefully is a simple ESQL function, any suggestions?
Back to top
View user's profile Send private message
jbanoop
PostPosted: Tue Aug 25, 2009 10:52 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

have you tried the CAST function ?
Back to top
View user's profile Send private message Yahoo Messenger
yortch
PostPosted: Tue Aug 25, 2009 11:10 am    Post subject: Reply with quote

Apprentice

Joined: 30 Aug 2004
Posts: 34

I just did, here is the working solution...

Code:
CAST(ASBITSTREAM(OutputRoot.XMLNSC) AS CHARACTER CCSID 1208)
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 » How to format XML in user trace (WMB 6.1)
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.