473,320 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

web service custom exceptions: SoapException.InnerException

http://msdn2.microsoft.com/en-us/library/ds492xtk.aspx

Is this the following excerpt from the above page incorrect, or is there a
bug in the .net 2.0 implementation? Or perhaps I have something configured
wrong. Basically, the doc says that when a custom exception type is thrown
from a web method, that the web service client app will receive a
soapexception with the soapexception.InnerException property set to reference
the custom exception. I aways get a null value, however (the .message
property does contain a merge of the soapexception message and my custom
exception message, however): The doc says:

When unhandled exception occurs: While executing the Web service method

What ASP.NET does: The exception is caught by ASP.NET and thrown back to the
client. The Web service client created using the .NET Framework receives a
SoapException with the specific exception placed in the InnerException
property

Any ideas on what is right (code or doc?) Thanks!
Mar 10 '06 #1
4 8490
Hi Asanford,

Welcome to MSDN newsgroup.

As for hte MSDN doc you mentioned, I've viewed it and it still remains the
same with the one for 1.1:

[2.0]
http://msdn2.microsoft.com/en-us/library/ds492xtk.aspx

[1.1]
http://msdn.microsoft.com/library/en...lingRaisingExc
eptionsInXMLWebServices.asp?frame=true

And for the "InnerException" property of the SoapException class, it is
used only when the exception is not captured within the webmethod, as
mentioned by the following statement:

"Exceptions Not Handled by an XML Web Service Method"

In another world, for general webservice's webmethod, when there occur an
exception and been throwed to clientside, the generated SoapException won't
contains InnerException info. Detailed exception info or customized
exception info should be stored in the SoapException.Detail property(an
xmlNode). You can see the example on use the Detail property in the 1.1
doc:

http://msdn.microsoft.com/library/en...lingRaisingExc
eptionsInXMLWebServices.asp?frame=true

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Mar 13 '06 #2
Hi Asanford,

Does my last message helps you a little on this question? If there's
anything else we can help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Mar 15 '06 #3
Hi, Steven,

Thanks for your response. Unfortunately, your reply doesn't clarify the
situation in my mind. It still seems the code doesn't agree with the
documentation. Can you clarify? One part of the doc says that if I throw an
exception, asp.net generates a soapexception and no indication is given as to
how innerexception is set or not set. Later, it says that if an exception is
unhanded in the web method, that a soapexception is created and the
innerexception set. But, I don't see the inner exception set. Maybe the
problem turns on what the doc means by an unhandled exception occurring in a
web method. To me, that could include the case where my web method generates
an exception, but does not catch it - and so it should go on to the client.
The doc says in this case the innerexception is set, but I've observed
otherwise.

thanks,
-A

"Steven Cheng[MSFT]" wrote:
Hi Asanford,

Welcome to MSDN newsgroup.

As for hte MSDN doc you mentioned, I've viewed it and it still remains the
same with the one for 1.1:

[2.0]
http://msdn2.microsoft.com/en-us/library/ds492xtk.aspx

[1.1]
http://msdn.microsoft.com/library/en...lingRaisingExc
eptionsInXMLWebServices.asp?frame=true

And for the "InnerException" property of the SoapException class, it is
used only when the exception is not captured within the webmethod, as
mentioned by the following statement:

"Exceptions Not Handled by an XML Web Service Method"

In another world, for general webservice's webmethod, when there occur an
exception and been throwed to clientside, the generated SoapException won't
contains InnerException info. Detailed exception info or customized
exception info should be stored in the SoapException.Detail property(an
xmlNode). You can see the example on use the Detail property in the 1.1
doc:

http://msdn.microsoft.com/library/en...lingRaisingExc
eptionsInXMLWebServices.asp?frame=true

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights

Mar 16 '06 #4
Thanks for response Asanford,

IMO, any webservice, webmethod specific exceptions should not utilize the
InnerException, so our client application should also not rely on that. I
think inner exception will be used only when the exception is thrown by the
.net framework or ASP.NET runtime which is out of the scope of webservice
engine. Anyway, in our client side code, we can first check the inner
exception, if it exists, we can pick up some further info form it.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Mar 20 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Marty McDonald | last post by:
If I invoke a web service, and it throws an exception, I can see the exception if the client app is a .Net app. However, if the client app is not a .Net app, I only receive the HTTP 500 error. I...
0
by: Dave S | last post by:
In .Net 1.1 SP1 Web services that raise exceptions that contain xml encodable characters such as ",< etc. are displayed incorrectly. For example the exception "The file "filename.txt" cannot be...
1
by: Vinoth Kumar | last post by:
Hi All, I have a problem in throwing custom exceptions from a webservice method. The custom exception is being converted into soapexception in the webservice client. only the custom exception...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
3
by: Tom | last post by:
I'm wiritng a dot.net windows forms appliction that needs to connect to a webservice to download some files. I need to show a progress bar during the download, bacause some file can be very big....
0
by: Nol | last post by:
Hi all, My webservice throws an exception, which is translated into a soap Fault in the soap message body. See below for the actual message format as it is send by the server. On the (dotNet)...
4
by: Nol de Wit | last post by:
(this is a re-post of a message I've posted last friday, but now from my MSDN subscription account, hoping MSDN support will pick this up...) Hi all, My webservice throws an exception, which...
2
by: Anthony Biondo Jr | last post by:
I was wondering how to handle an error in a web service. If our web service encounters a connection error or any other error what is the best practice for returning an error? Do you return a...
3
by: Tomsawyer2kin_hotmail | last post by:
Hi, I created a custom Exception Class as Public Class CSTException : Inherits System.ApplicationException ' required to over ride the base class method Sub New(ByVal ExceptionCode As...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.