WebService timeout

Hi,

I m using the time out feature of Webservice request,  and i want to catch this timeout exception by a specific class, not by system.net.webexception class, i tried to look if theres  any specific timeoutexception class for web service request,  but didnt find any yet.  

The reason is that i need to display custom timeout messages when time out occurs, not just   exception  message through e.Message.

Can someone help me with this.
jyotishbAsked:
Who is Participating?
 
ozymandiasCommented:
Actually, there is a special kind of WebException for Timeout but its not another class.

Look at the WebException.Status property, if it is WebExceptionStatus.Timeout then you know you have a timeout.
0
 
ozymandiasCommented:
What verions of .net are you using.
Can you show some code of how you are using the timeout ?
0
 
ozymandiasCommented:
Can you not just catch the System.Net.WebException and then throw a timeout exception class of your own if the webexception message is "The operation has timed-out.".
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.