I've created a custom PolicyAssertion. When I return false from
IsSatisfiedBy how can I specify a custom error message (a custom soap fault
message to be exact)?
Right now all that is returned to the client is:
"The message does not conform to the policy it was mapped to."
If I have multiple custom policies I would like to give some feedback as to
which one has failed.
Is there a way to do this?
(Also, I've tried throwing an exception in IsSatisfiedBy but all this does
in return "Server is busy or unavailable." to the client.)
TIA,
Alex
The only way is to add something to a database (easier)/ file when you
have an assertion failure in your custom policy assertion. And then add
a soap filter that inspects the soap message for faults and if it
encounters a WSE402, look for the entry in the database based on a
correlation id for the request and throw a fault with the appropriate
message, else just pass the fault along.
> I've created a custom PolicyAssertion. When I return false from
> IsSatisfiedBy how can I specify a custom error message (a custom soap fault
[quoted text clipped - 13 lines]
> TIA,
> Alex

Signature
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilip.krishnan AT apdiya DOT com
alex bean - 12 May 2005 20:54 GMT
> The only way is to add something to a database (easier)/ file when you
> have an assertion failure in your custom policy assertion. And then add
> a soap filter that inspects the soap message for faults and if it
> encounters a WSE402,
I was trying to avoid having to override the SoapExtension class (I'm
guessing that's what you mean by "soap filter"). Besides, if I did go that
route there would be no need to do that database/file thing since I could
inspect the soap message in the SoapExtension override as opposed to
inspecting it in the PolicyAssertion override and then catching it later on
in the SoapExtension override.
But thanks for the idea.