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

Best practise of throwing errors and defining error contract

Can some some guide me to a good link on how to throw errors in a webservice?
Also if there is a standard way of defining different degress of erros while
exposing your webservice to thrid parties?

e.g. Service is busy is category 3 error,
Credit Card Validation failed is a category 1 error,
Retry after some time category 2 error etc

or are these error just returned as a saop fault? without any categories?
Nov 4 '06 #1
3 1570
"Baheri" <Ba****@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Can some some guide me to a good link on how to throw errors in a
webservice?
Also if there is a standard way of defining different degress of erros
while
exposing your webservice to thrid parties?

e.g. Service is busy is category 3 error,
Credit Card Validation failed is a category 1 error,
Retry after some time category 2 error etc

or are these error just returned as a saop fault? without any categories?
Soap faults are the standard way to return errors from a web service. You
can define whatever data you want to return in the detail element of the
SOAP fault, and your clients can interpret that in any way they like.

I question whether the server should be telling the client how severe the
error is; the server should be telling the client _what_ the error is,
whether it's caused by the client or the server, and should perhaps give
some indication of how likely it is that the error will recur if the client
tries again without changing what it sends.

John
Nov 5 '06 #2
If you are looking for how to use faults in ASMX, try this article I wrote a
few years ago.

http://msdn.microsoft.com/library/de...ce09172002.asp
"John Saunders" wrote:
"Baheri" <Ba****@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Can some some guide me to a good link on how to throw errors in a
webservice?
Also if there is a standard way of defining different degress of erros
while
exposing your webservice to thrid parties?

e.g. Service is busy is category 3 error,
Credit Card Validation failed is a category 1 error,
Retry after some time category 2 error etc

or are these error just returned as a saop fault? without any categories?

Soap faults are the standard way to return errors from a web service. You
can define whatever data you want to return in the detail element of the
SOAP fault, and your clients can interpret that in any way they like.

I question whether the server should be telling the client how severe the
error is; the server should be telling the client _what_ the error is,
whether it's caused by the client or the server, and should perhaps give
some indication of how likely it is that the error will recur if the client
tries again without changing what it sends.

John
Nov 6 '06 #3
Hi Scott,

Thanks the link was useful. Do you know of any link that lists or describes
the Typical webservice errors that are not in the control of your application
e.g. Service is Busy, Service unavailable etc?

Regards,
Pancham

"Scott Seely" wrote:
If you are looking for how to use faults in ASMX, try this article I wrote a
few years ago.

http://msdn.microsoft.com/library/de...ce09172002.asp
"John Saunders" wrote:
"Baheri" <Ba****@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Can some some guide me to a good link on how to throw errors in a
webservice?
Also if there is a standard way of defining different degress of erros
while
exposing your webservice to thrid parties?
>
e.g. Service is busy is category 3 error,
Credit Card Validation failed is a category 1 error,
Retry after some time category 2 error etc
>
or are these error just returned as a saop fault? without any categories?
Soap faults are the standard way to return errors from a web service. You
can define whatever data you want to return in the detail element of the
SOAP fault, and your clients can interpret that in any way they like.

I question whether the server should be telling the client how severe the
error is; the server should be telling the client _what_ the error is,
whether it's caused by the client or the server, and should perhaps give
some indication of how likely it is that the error will recur if the client
tries again without changing what it sends.

John

Nov 8 '06 #4

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

Similar topics

2
by: Brian | last post by:
Hi there, I am converting a large PL/SQL project into Transact-SQL and have hit an issue as follows: I have a PL/SQL procedure that converts a string to a date. The procedure does not know...
2
by: Aadam | last post by:
Does Microsoft have a best practices for tracking errors? (like in a database, what info, etc)
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
4
by: Amadelle | last post by:
Hi all and thanks again in advance, What is the best way of defining global constants in a C# application? (A windows application with no windows forms - basically a set of classes). Would it be...
10
by: Mike Logan | last post by:
I am using the "contract first" design methodology. Contract First is design the WSDL first then design the server and client. However I must design my XSD/XML Schema before anything. I am...
14
by: Jon Rea | last post by:
I am currently cleaning up an application which was origainlly hashed together with speed of coding in mind and therefore contains quite a few "hacky" shortcuts. As part of this "revamping"...
10
by: Barry Morris | last post by:
Hi I am a php newbie although I have been a programmer for years, this can be dangerous because all the languages I know use = as equal comparison so it took me a long time to debug if ($STRING...
24
by: Earl | last post by:
I have all of my data operations in a separate library, so I'm looking for what might be termed "best practices" on a return type from those classes. For example, let's say I send an update from...
41
by: =?Utf-8?B?VGltIE1hcnNkZW4=?= | last post by:
Hi, I am after suggestions on the best practice declaring and destroying objects. some example code: Private Sub MySub Dim frmMyForm As MyForm Try
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.