Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2005

Tip: Looking for answers? Try searching our database.

custom error message for custom PolicyAssertion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alex bean - 12 May 2005 16:10 GMT
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
Dilip Krishnan - 12 May 2005 20:32 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, 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.