Hi Shobhit,
Thank you for sharing the example. We have a different approach, we don't raise errors from the code we write, we structure the code in a way that services will always finish gracefully and giving a response object.
Something like this:
- At least one assertion must evaluate to true
- All must be true
<policy logic, routing, etc.>
- Return template Response to Requestor
- All must be true (Error)
- build our standard error response
- Return template Response to Requestor
- Stop processing
As you can see we don't use neither "Raise Error" nor "Customize Error Response" assertions.
All I want is to customize the default SOAP error response given by the Gateway but when I do that any error coming from the code that we don't control (e.g. OTK) will be captured and replaced by the "Customize Error Response" on the "Global Message Received" policy. Maybe I should look for a different approach.
Thank you,
Roman