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 / January 2007

Tip: Looking for answers? Try searching our database.

Custom SoapFilter for WSE 3 and Exceptions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephan Zahariev - 19 Jan 2007 13:34 GMT
Hello

I'm developing custom SoapFilter for WSE 3.0. Is there a way to find out the
type of exception occurred during the execution of WebMethod.

The SoapEnvelope parameter of ProcessMessage method has a Fault property,
but this fault property always contains SoapException, not the original type
of the exception.

How to find out the original type of the exception?

Best regards
Stephan Zahariev
Steven Cheng[MSFT] - 22 Jan 2007 08:07 GMT
Hello Stephan,

From your description, I understand you're developing a soapFilter to
intercept some info from the soap message of each webservice method call.
However, for exceptions occured in webmethods, you found that they're
always encapsulated as a SoapException object. So you wonder how to get the
original exception info, correct?

Based on my understanding, for ASP.NET webservice, all the server-side
unhandled exceptions will be wrappered with a SoapException and then the
SoapException will be serailzied as XML element and contained in SOAP
message's <fault> standard element.  Therefore, if you want to get original
exception info at cilent-side, you may need to lookup the properties of
SoapException.  

for server-side, in your case, you're using custom WSE SoapFilter, the
SoapEnvelope's "Fault" property contains the SoapException that will also
be captured at client-side. And it doesn't contain the original exception
info(be encapsulated into SoapException's properties).

So far, to intercept the raw exception info in ASP.NET
webservice(server-side), one way is to use SoapExtension. The
SoapExtension's ProcessMessage method pass in a SoapMessage class instance,
it contains a "Exception" property and this Exception instance's
"InnerException" property refer to the original unhandled exception. Here
are some web articles describing on this:

#User Friendly ASP.NET Exception Handling
http://www.codeproject.com/aspnet/ASPNETExceptionHandling.asp

#Exception Injection Using a Custom SOAP Extension
http://haacked.com/archive/2005/06/29/ExceptionInjectionUsingCustomSoapExten
sion.aspx

Actually, the WSE 3.0 component itself is implemented as a SoapExtension,
and since it has remove the original exception from the SoapEnvelope, you
can not get the original exception instance directly in WSE custom Filter.

Hope this helps some. If you have anything unclear on this, please feel
free to let me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
Stephan Zahariev - 23 Jan 2007 08:41 GMT
Hello Steven,

I'm sorry about the inability to catch original exception inside WSE filter,
but custom SOAP extension will do the job.

Thank you for the complete and helpful answer.

Stephan Zahariev

> Hello Stephan,
>
[quoted text clipped - 68 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Steven Cheng[MSFT] - 23 Jan 2007 09:35 GMT
Thanks for your reply Stephan,

Yes, for the WSE component, its custom filter may focus more on the
serialized SOAP content(and itself is a sub node of a SoapExtension), that
makes it a bit limited on accessing other webservice intrinsic
objects/members.  

In addition, I think it would be a good idea that the sequential service
component will add more flexibility and customization features on WSE like
component. therefore, you're welcome to submit your request or comments  to
the MSDN product feedback center:

http://connect.microsoft.com/feedback/default.aspx?SiteID=210

Anyway if you have any other questions or anything else we can help, please
feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] - 25 Jan 2007 10:14 GMT
Hi Stephan,

I'm following-up this post since Steven is OOF. Please let us know if you
have any other questions regarding this post. Thanks.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Rate this thread:







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.