Sunday, October 23, 2011

Using Raise Error in OSB

If in your Message Flow you Raise Error:

Raise Error using error code [ MY_ERROR_CODE ] with error Message MY_ERROR_MESSAGE

the error handler will show in the
"errorCode" and "reason" respectively the
"error code and "error message"
that you have provided:

<con:fault xmlns:con="">

both Service Error Handler and System Error Handler are invoked with the same fault, because in my Message Flow, the Service Error Handler doesn't handle the error:

If the Service Error Handler does a "reply with success", the same body as the request is returned in the response.
If the Service Error Handler does a "reply with error", the test console returns a message "The invocation resulted in an error: ."

Analyzing with SOAP UI (I create a Rest service and do a POST), if I show the RAW response I get:

HTTP/1.1 500 Internal Server Error
Date: Sun, 23 Oct 2011 21:45:50 GMT
Content-Length: 61
Content-Type: text/xml; charset=utf-8
X-Powered-By: Servlet/2.5 JSP/2.1

<?xml version="1.0" encoding="UTF-8"?>

in fact "Reply with Error" returns a HTTP 500

see also on how to raise an error in XQuery

No comments: