473,411 Members | 2,185 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,411 software developers and data experts.

Managing exceptions in web services (showing errors)

I use to show the error messages that I get in a try block.

try
{
...
}
catch (Exception ex)
{
... (ex.Message);
}

In a Windows App I use: Message.Show(ex.Message);

As the web service can be used in Windows apps or ASP.NET apps, what is the
way to do that?

Regards,

Diego F.
Nov 21 '05 #1
1 1646
You may want to read following article:
http://www.microsoft.com/belux/nl/ms...xceptions.mspx
Throwing SoapExceptions
Summary:

Sometimes things can go wrong when code is executed, so Exceptions are
thrown. When your application exposes services through a webservice layer,
SoapExceptions are thrown from the server to the client. By default normal
Exceptions are converted to a SoapException, resulting in a rather ugly
Exception containing all information concatenated in a long String. But
luckily the SOAP protocol allows any XML document to be included in SOAP
error messages. This article shows how to build some helper classes to
easily pass error information from the server to the client through a
webservice layer.

--
Greetz
Jan
________________
Read my weblog: http://weblogs.asp.net/jan
"Diego F." <di*****@NOterra.es> schreef in bericht
news:u4****************@TK2MSFTNGP12.phx.gbl...
I use to show the error messages that I get in a try block.

try
{
...
}
catch (Exception ex)
{
... (ex.Message);
}

In a Windows App I use: Message.Show(ex.Message);

As the web service can be used in Windows apps or ASP.NET apps, what is the way to do that?

Regards,

Diego F.

Nov 21 '05 #2

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

Similar topics

24
by: mag31 | last post by:
Is there any way to find out if a particular .net function will throw an exception without first generating the exception? I am using structured exception handling i.e. try catch finally blocks...
5
by: Steve | last post by:
Hi... new to ASP.NET... I am creating a DLL using VB.NET which my ASPX page will be calling. I have a class in the DLL (MyClass) which has a property (MyProperty). If the value assigned to...
40
by: Mark P | last post by:
I'm implementing an algorithm and the computational flow is a somewhat deep. That is, fcn A makes many calls to fcn B which makes many calls to fcn C, and so on. The return value of the outermost...
8
by: Richard Collette | last post by:
When attempting to debug a webservice, I get the error: Cannot serialize member System.Exception.Data of type System.Collections.IDictionary, because it implements IDictionary. In reading...
1
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
0
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
6
by: Liming | last post by:
Hi, In a typical 3 tier model (view layer, busines layer and data access layer) where do you handle your exceptions? do you let it buble up all the way to the .aspx pages or do you handle it in...
15
by: =?Utf-8?B?TWljaGVsIFBvc3NldGggW01DUF0=?= | last post by:
In my opinion rethrowing exceptions without providing anny extra information is a totall waste Examples : in my opinion wrong : A: Public sub DoSomeStuff() Try do it
37
by: Sweetiecakes | last post by:
Hello I'm a bit confused on how one should handle exceptions. I'm currently building an ADO.NET Windows Forms application. I've built a class for manipulating data within the database in...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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...

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.