Wednesday, December 14, 2011

Assigning a value to $fault

I was trying to assign a value to $fault in a "Error Reporting" service, to see if the built-in "Report" action could parse the $fault and populate the right fields in the Error Report message.

This is a sample $fault:

<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>MYERROR</con:errorCode>
  <con:reason>MYMESSAGE</con:reason>
  <con:location>
    <con:node>PipelinePairNode1</con:node>
    <con:pipeline>PipelinePairNode1_request</con:pipeline>
    <con:stage>stage1</con:stage>
    <con:path>request-pipeline</con:path>
  </con:location>
</con:fault>


Unfortunately the $fault variable is meaningful only in the error handler.
If you try to use it in a normal message flow, you get:

Variable name validation failed: The variable "fault" cannot be used here

No comments: