[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

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.
0
jyotishb
Asked:
jyotishb
  • 3
1 Solution
 
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
 
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now