473,672 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

howto get exception information from asp.net webservice, without try and catch

dan
hi ng.

i have a asp.net application which is client of an asp.net webservice.
now i want to configure a custom error page (in case the sewrvice throws an
exception)
that provides the soapexception detail property as text.
but when defined in web.config, the error page doesn't provide access to the
thrown exception anymore.
i think that i somehow have to enter the http pipeline to catch the error,
read the data and transfer to a error page. is this right?
but i have no cue where to begin and what excactly i have to look for.

what i have been reseaching was the soapextension class where it was
possible to intervene the incoming soap fault.
but i couldn't avoid the exception to get thrown.
(of course i do not want to set up a try-catch solution)

thank you very much for your help,
dan
Nov 19 '05 #1
2 2403
If your webservice is failing, then you shouldn't show a HTML page to the
user. Typically the client of your webservice is not a human, so passing
back HTML makes little sense. The SOAP protocol includes error handing with
SoapFaults, so you should let the web service framework map the error on
your side to the SoapFault back to the client.

-Brock
DevelopMentor
http://staff.develop.com/ballen
hi ng.

i have a asp.net application which is client of an asp.net webservice.
now i want to configure a custom error page (in case the sewrvice
throws an
exception)
that provides the soapexception detail property as text.
but when defined in web.config, the error page doesn't provide access
to the
thrown exception anymore.
i think that i somehow have to enter the http pipeline to catch the
error,
read the data and transfer to a error page. is this right?
but i have no cue where to begin and what excactly i have to look
for.
what i have been reseaching was the soapextension class where it was
possible to intervene the incoming soap fault.
but i couldn't avoid the exception to get thrown.
(of course i do not want to set up a try-catch solution)
thank you very much for your help,
dan


Nov 19 '05 #2
dan
hi brock,

the webservices provides a fault message. and as my client is a dotnet
client (a asp.net website), a saopexception gets generated from this fault
message.
what i want to do is to provide some information from the
soapexception.D etail property (which is set on serviceside when the
exception occurs ) to a standard error side that is invoked when a
soapaexception occurs.

example:

serviceside:
definition of node

SoapException se = new SoapException(" Concurrency
eroor",SoapExce ption.ClientFau ltCode,"",node) ;

throw se;
->i have to throw a soapexception because otherwise, i don't get information
about the exception on client side (inner exception property of
soapexception is null!)

clientside:
try....

catch(System.We b.Services.Prot ocols.SoapExcep tion ex)

{

System.Xml.XmlN ode node=ex.Detail;

foreach(System. Xml.XmlNode nod in node.ChildNodes )

{

string s=nod.InnerText ;

s="";

}

dan


"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:79******** **************@ msnews.microsof t.com...
If your webservice is failing, then you shouldn't show a HTML page to the
user. Typically the client of your webservice is not a human, so passing
back HTML makes little sense. The SOAP protocol includes error handing
with SoapFaults, so you should let the web service framework map the error
on your side to the SoapFault back to the client.

-Brock
DevelopMentor
http://staff.develop.com/ballen
hi ng.

i have a asp.net application which is client of an asp.net webservice.
now i want to configure a custom error page (in case the sewrvice
throws an
exception)
that provides the soapexception detail property as text.
but when defined in web.config, the error page doesn't provide access
to the
thrown exception anymore.
i think that i somehow have to enter the http pipeline to catch the
error,
read the data and transfer to a error page. is this right?
but i have no cue where to begin and what excactly i have to look
for.
what i have been reseaching was the soapextension class where it was
possible to intervene the incoming soap fault.
but i couldn't avoid the exception to get thrown.
(of course i do not want to set up a try-catch solution)
thank you very much for your help,
dan


Nov 19 '05 #3

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

Similar topics

8
1382
by: Jonah Olsson | last post by:
Hi guys, For my VB.NET application, I created an ErrorHandler class that should save all available information about the last error occurred. I use Server.GetLastError for this. The problem is that I quite often get errors that I really can't say why they happen because of the lack of information from GetLastError. This is an example: System.NullReferenceException: Object reference not set to an instance of an
1
5380
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried, and all examples I have found that other people says works - doesn't work for me :-(
5
5390
by: Topper | last post by:
Hello! How to create WebService without IIS and ASP.NET? For example, create WebService for smart device client without ASP.NET/IIS techology. Without ASP.NET and IIS - is a key question!! May somebody knows where can i get information or examples for current subject....
8
4180
by: Topper | last post by:
Hello. I have simple web folders structure: -ROOT - BIN WebService.dll WebService.asmx I need to use my WebService.dll not in bin folder - for example, in ROOT. How do i this? How can i do this without .config file only with some configuration
10
1869
by: WhiskyRomeo | last post by:
I have webservices functions that return datasets. If a database errors happens, try catch statements can be used in the webservice to detect and handle them. However, how do I return that message to the client windows application that called that webservice function? I am using version 1.1 of the framework. WR
7
5129
by: Sek | last post by:
Hi Folks! I was pondering over a code and noticed that exception handlers were present in the private, protected as well as public methods. And, ofcourse, public methods were calling priv/prot methods internally. My thought was, the exception is being rethrown and propagated by the non-public methods to the public methods, causing performance overhead (stack winding etc). I do agree that, the purpose of throwing the exception by...
6
2490
by: Pieter | last post by:
Hi, For some procedures that throws exceptions, I would like to show different messages to the user depending on what type of exception he's getting. For instance this one: when the file is locked, I want a messagebox to tell that the user has to close the file first. Is there a way to identify an exception by some kind of unique number or something like this? I don't want to identify it on the Exception Message because some users are...
3
13927
by: =?Utf-8?B?SGVtaWw=?= | last post by:
Hi, I have written a web service for accessing data from a database. I have a method in the webservice which returns a dataset. I am trying to implement error handling by using the try...catch...finally structure. Now, the method's logic in the try block returns a dataset while the the code in the 'catch' block throws an exception object of the SoapException class. Before, returning an exception to the calling code, I build up an...
8
3393
by: reuce-google | last post by:
Hi folks, I want to store an exception and rethrow it later: CException m_pEc = NULL; // Class variable. try { throw new CMemoryException(); }
0
8418
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
8943
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
8844
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
8638
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,...
1
6254
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
5720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4438
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2089
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1834
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.