Changing the Timeout Value in C# .NET for Web Service Requests
search cancel

Changing the Timeout Value in C# .NET for Web Service Requests


Article ID: 339702


Updated On:


VMware vSphere ESXi


When VirtualCenter is performing tasks from certain Web service calls, for example WaitForUpdates or CreateVM, sometimes I receive a timeout message from my Web services client even though VirtualCenter has completed the task. How can I change the timeout value used for Web services requests?


VMware Infrastructure SDK 2.0.x
VMware Infrastructure SDK 1.x


Timeout is a property of the SoapHttpClientProtocol class. The timeout option specifies the time an XML Web service client waits for a synchronous XML Web service request to complete. This value is measured in milliseconds.
  • VisualStudio provides information in their online help on the class, SoapHttpClientProtocol, and its member, TimeoutProperty .
  • From VisualStudio, referencing the online help as needed, use the VimService properties to set the service.Timeout=<NewTimeoutValue>.
  • When set, this new timeout value is used for all future Web service requests.

Sample process for changing timeout property in SvcConnection:
  1. Open SvcConnection.
  2. Select Connect method type.
  3. Select _service.
  4. Type a period (.) to view the public properties and methods. Timeout is one of the properties.
  5. Scroll to the Timeout property.
  6. Select it and press Enter.
  7. Enter the timeout value you need.