by Thiru Thangarathinam, Intel Corp.
An exception is any error condition or unexpected behavior encountered by an executing program. Exceptions can occur for a number of reasons, such as faulty code, unavailable operating system resources, unexpected Common Language Runtime conditions, and so on. While your application can recover from some of these conditions, most runtime exceptions are irrecoverable. In that case, you need an effective way of handling the exception.
Web services are a relatively new form of distributed computing. In distributed computing, applications are designed as services that run on a server. Clients access these services through a programmable interface. When there is an exception during the execution of a Web service, the exception not only needs to be captured, but it also must be communicated back to the consumers of the Web service.
Since Web services provide a platform-independent of way of leveraging a specific functionality, the exceptions that occur in Web services must also be communicated in a platform-independent manner. To accomplish this communication, it must be compliant with the SOAP specification.
.NET Provides Robust Structured Exceptions Handling
The crux of the exception handling support in a .NET Web service is provided by the try Catch finally construction. The try keyword precedes a block of normal processing code that may throw an exception. The catch keyword precedes a block of exception-handling code. The finally keyword precedes a block of code that will always be executed after handling the exceptions. Once an exception is thrown from a try block, the program flow switches to the first catch block following it.
A well-designed set of error-handling code blocks can go a long way in making a program more robust and less prone to crashing. The best practices for handling exceptions can be summarized as follows:
![]()
![]() | Java and .NET both bring something to the party by Paul Steinberg, Sharat Agarwal, and George Vorobiov. Intel Corp. ... |
![]() | Consolidating the IT infrastructure: leveraging Oracle9i Real Application Clusters on Intel to build an 'Adaptive Architecture' Intel Corp., Oracle Corp., and Cap Gemini Ernst & Young. Cap Gemi... |
If you're interested in this topic, these articles may be helpful:
![]() | Web services: the powerful tenets of SOA by Jason Bloomberg and Ron Schmelzer, senior analysts, ZapThink LLC ... |
![]() | Consuming WebSphere Application Server Web services from Eclipse Rich Client Platform applications This tutorial teaches you how to configure an Eclipse® Rich Client... |
![]() | Adding Security to your Web Services Digital Signatures, Part 2 This demo shows how to expose a simple Java™ class as a Web serv... |
![]() | The path to successful Web services: navigating the pitfalls by Jason Bloomberg, senior analyst, ZapThink LLC Abstract Web serv... |
![]() | Developing Web services with Java 2 Platform, Enterprise Edition 1.4 by Qusay H. Mahmoud, Sun Microsystems Inc. The Java 2 Platform,... |
![]()
Related Jobs:
![]() | Consultant #150477 - WA - Issaquah - Microsoft Corporation MS Services Labs Job Title: Consultant Target Range: 60-64 Location... |
![]() | Senior .NET Developer #16348 - US - New York - Bloomberg L.P. DESCRIPTION: The Microsoft Technology Research team is looking for e... |
![]() | Consultant #150537 - NY - New York - Microsoft Corporation The Microsoft Premier Customer Lab Team is looking for experienced con... |
![]() | Program Manager #151602 - WA - Redmond - Microsoft Corporation Would you like to work on the very heart of managed code? Are you pass... |
![]() | Software Development Engineer #149750 - CA - Mountain View - Microsoft Corporation We are seeking creative, highly motivated software engineers, both for... |
![]() | Consultant #150539 - CA - San Diego - Microsoft Corporation MS Services Labs Job Title: Consultant Target Range: 60-64 Location... |
![]() | Software Development Engineer in Test #151333 - WA - Redmond - Microsoft Corporation The Common Language Runtime -CLR- stress test team is looking for a so... |
![]() | Program Manager #145872 - WA - Redmond - Microsoft Corporation Developer Division Setup team is looking for a senior PM who can provi... |
![]() | Software Development Engineer #142863 - WA - Redmond - Microsoft Corporation You use e-mail every single day. Did you ever have a crazy idea about ... |
![]() | Software Development Engineer #136643 - WA - Redmond - Microsoft Corporation Are you passionate about working on business applications built on the... |


