SQLAuthority News – Guest Post – FAULT Contract in WCF with Learning Video

This is guest post by one of my very good friends and .NET MVP, Dhananjay Kumar. The very first impression one gets when they meet him is his politeness. He is an extremely nice person, but has superlative knowledge in .NET and is truly helpful to all of us.

Objective:

This article will give a basic introduction on:

  1. How to handle Exception at service side?
  2. How to use Fault contract at Service side?
  3. How to handle Service Exception at client side?

A Few Points about Exception at Service

  1. Exception is technology-specific.
  2. Exception should not be shared beyond service boundary.
  3. Since Exception is technology-specific, it cannot be propagated to other clients.
  4. Exception is of many types.
  • CLR Exception
  • Windows32 Exception
  • Runtime Exception at service
  • C++ Exception
  1. Exception is very much native to the technology in which service is made.
  2. Exception must be converted from technology-specific information to natural information that can be communicated to the client.

SOAP Fault


FaultException<T>

  1. Service should throw FaultException<T>, instead of the usual CLR exception.
  2. FaultException<T> is a specialization of Fault Exception.
  3. Any client that programs against FaultException can handle the Exception thrown by FaultException<T>.
  4. The type parameter T conveys the error detail.
  5. T can be of any type like Exception, CLR Type or any type that can be serialized.
  6. T can be of type Data contract.
  7. T is a generic parameter that conveys the error details.

You can read complete article http://dhananjaykumar.net/2010/05/23/fault-contract-in-wcf-with-learning-video/

Reference: Pinal Dave (http://blog.sqlauthority.com)

About these ads

One thought on “SQLAuthority News – Guest Post – FAULT Contract in WCF with Learning Video

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s