There may be many different kinds of exceptions that may occur at the client side. But client channels need to be prepared for two main exception types :
1. Communication Exceptions - This is a base class that represent various runtime communication errors. This exception is a generalize exception to catch any type of communication exception that is thrown by your service operation also known as Fault Exception. They typically represent business oriented exceptions.
2. Timeout Exception - It is not delivered from communication exception. This represents the error that occurs when send timeout limit exceeded. So when you are writing your client side communication logic, you need to take it into account these various types of exceptions that can occur. Remember that after certain exceptions, the client side channel may enter into "faulted" state which will require you to call abort on the channel instead of close.
catch(CommunicationException ce)
{
client.Abort();
}
To Catch Timeout Exception :
catch(TimeoutException te)
{
client.Abort();
}
1. Communication Exceptions - This is a base class that represent various runtime communication errors. This exception is a generalize exception to catch any type of communication exception that is thrown by your service operation also known as Fault Exception. They typically represent business oriented exceptions.
2. Timeout Exception - It is not delivered from communication exception. This represents the error that occurs when send timeout limit exceeded. So when you are writing your client side communication logic, you need to take it into account these various types of exceptions that can occur. Remember that after certain exceptions, the client side channel may enter into "faulted" state which will require you to call abort on the channel instead of close.
To Catch Communication Exception :
{
client.Abort();
}
To Catch Timeout Exception :
catch(TimeoutException te)
{
client.Abort();
}
No comments:
Post a Comment