Author |
Message
|
rajparekh08 |
Posted: Mon Nov 09, 2009 4:38 am Post subject: How to track Parser Exception |
|
|
Acolyte
Joined: 21 Sep 2009 Posts: 58 Location: India- Bagalore
|
Hi,
In my trace, I get the followin:
The message broker detected an error whilst processing a message in node 'XXXX.HTTP Request from Service Consumer SOAP'.
The message has been augmented with an exception list and has been propagated to
the node's catch terminal for further processing.See the following messages for details of the error.
2009-11-09 05:13:06.385543
8984 RecoverableException BIP2230E: Error detected whilst processing a message in node 'XXXX.ResetContentDescriptor1' The message broker detected an error whilst processing a message in node 'XXXX.ResetContentDescriptor1'. An exception has been thrown to cut short the processing of the message.See the following messages for details of the error.
2009-11-09 05:13:06.385560 8984 ParserException BIP5285E: Message Translation Interface Parsing Errors have occurred:
Message Set Name : ''WebserviceMessageSet'' Message Set Level : '1'
Message Format : ''XML1'' Message Type Path : ''Envelope''
Review further error messages for an indication to the cause of the errors.
2009-11-09 05:13:06.385579 8984 ParserException BIP5367E: Message Validation failure. Invalid value for element
'http://www.XXXX.com/schemas/XXXX/XXXXX:CardNbr'. The value '0' is not in the list of allowed values.The value for the element in the message Modify the message set or messageflow and redeploy to the broker or modify the input message and resubmit to the broker.
Basically, the value for the tag "cardnmr" is absent.
So a parser error is thrown.
I use the following in my code to catch the exception and send it to the requester:
DECLARE start REFERENCE TO InputExceptionList.ParserException;
SET messageText = start.Insert.Text;
set messageText2 = start.Insert.Text;
set OutputRoot.XML.Error.text[i] = messageText;
The o/p of above is :
<Error><text>Caught exception and rethrowing</text><text>ImbRecoverableException caught from worker->parse.</text><text>Field is not one of the allowed enumeration values</text></Error>
Well the requirement is to get the parser exception error which explictly tells that the cardnbr value is incorrect.
How to i look into the parserexception and pull out the error text
Help |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Nov 09, 2009 4:48 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Hint:
Wire up the Catch Terminal of your Input Node to a Trace node and get it to output ${ExceptionList}. _________________ 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 |
|
 |
kimbert |
Posted: Mon Nov 09, 2009 5:39 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Another hint: Using a Trace node is not the answer. smdavies99 is telling you how to *find* the answer.  |
|
Back to top |
|
 |
rajparekh08 |
Posted: Mon Nov 09, 2009 8:27 pm Post subject: |
|
|
Acolyte
Joined: 21 Sep 2009 Posts: 58 Location: India- Bagalore
|
kimbert wrote: |
Another hint: Using a Trace node is not the answer. smdavies99 is telling you how to *find* the answer.  |
What if I want to do it without a Trace node?
Just peep into the exceptionlist and get the fault.
here, it is a parser exception, and all I want is the error,
say if a mandatory tag is missing, I want the parser exception,pointing out which tag is missing or so.. Cause the end users of this service, will have no idea how MQ/MB works. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 09, 2009 8:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well the hint is still the same. You need not use the trace node.
You should however look at the last 3 text information on the bottom of the Exception tree?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Nov 09, 2009 11:06 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I suggested the use of a trace node so that you can see the exceptionlist in all it multilevel glory. A 'Transformation type' node placed after that would allow you to navigate the exceptionlist and extract the relevant info as suggested by fjb_saper.
This is how I learnt about using the information so generously provided in ExceptionLists. Maybe you can too? _________________ 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 |
|
 |
WMBDEV1 |
Posted: Tue Nov 10, 2009 12:47 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
|
Back to top |
|
 |
rajparekh08 |
Posted: Tue Nov 10, 2009 2:25 am Post subject: |
|
|
Acolyte
Joined: 21 Sep 2009 Posts: 58 Location: India- Bagalore
|
Hi,
It is done, I pull out the exception using the ExceptionList.
That is i pull it out from the "Insert" child of the Recoverable Exception.
Now my next doubt is, Is it possible to check for the value in the incoming XML message in a message set?? Say I dont want the tag CardNbr to be empty. Is it possible?? |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Tue Nov 10, 2009 2:28 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
You should be able to do this using minimum length constraints, assuming you have validation enabled when parsing. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Nov 10, 2009 6:59 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
If you are validating an XML message, you should be using XMLNSC. Unless you're still on v6.0. |
|
Back to top |
|
 |
rajparekh08 |
Posted: Mon Nov 16, 2009 9:58 pm Post subject: |
|
|
Acolyte
Joined: 21 Sep 2009 Posts: 58 Location: India- Bagalore
|
kimbert wrote: |
If you are validating an XML message, you should be using XMLNSC. Unless you're still on v6.0. |
Yeah, I am using v6.0. There is no way I can change this. It is at enterprise level. |
|
Back to top |
|
 |
|