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.