473,883 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

web service custom exceptions: SoapException.I nnerException

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.I nnerException 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 8525
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
eptionsInXMLWeb Services.asp?fr ame=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.D etail 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
eptionsInXMLWeb Services.asp?fr ame=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
eptionsInXMLWeb Services.asp?fr ame=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.D etail 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
eptionsInXMLWeb Services.asp?fr ame=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
4216
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 believe this is due mostly to the fact that the non-.Net apps are using POST instead of SOAP. If the non-.Net apps were using SOAP, they too would in fact "see" the exception. Is this true? Thanks!
0
1185
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 found" at the server becomes "The file "filename.txt" cannot be found" at the client. This is because of a double encoding bug in the faultstring generator with the web service protocol code. The relevant methods by using Lutz Roeders...
1
3234
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 message is present in the soapexception . Is there any way to get the exact custom exception instead of soapexception? Thanks in advance
3
5012
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 : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
3
2746
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. How Can i Mkae this? Can i use a stream? There are some samples? I'm thinking to use a byte array to get, for each call, a chunck of bytes, but I think also that in this way i'll made a lot of HTTP calls...
0
1477
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) client I get (catch) this as a SoapException (or SoapHeaderException). The SoapException contains various (string type) fields. For example, the Message fields contains the fully qualified name of the exception on the server side. The...
4
4481
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 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) client I get (catch) this as a SoapException (or SoapHeaderException). The SoapException contains...
2
1912
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 blank result with an error attached or is there some other way to do this? thanks, Anthony
3
5631
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 AppExCodes) MyBase.New(CStr(ExceptionCode)) End Sub end class
0
9942
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10416
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7971
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5991
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4220
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.