Microsoft KB Archive/815209

= BUG: You receive a &quot;The operation has timed-out&quot; error message when you access a Web service or when you use the IPAddress class =

Article ID: 815209

Article Last Modified on 5/12/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.1
 * Microsoft Web Services Enhancements for Microsoft .NET 1.1

-



SYMPTOMS
In Microsoft Visual Studio .NET 2003, when you try to add a Web reference to a Web service, or when you call a Web service method, you may receive the following error message:

There was an error downloading 'http:// / / '. The operation has timed-out.

Note  is a placeholder for the name of your Web server,   is a placeholder for the path of the Web service, and   is the name of the Web service.

In addition, when you use the IPAddress class, you may receive a &quot;System.TypeInitializationException&quot; exception. For example, when you use the Web Service Description Language tool (Wsdl.exe) to try to create a Web service proxy file, you may receive the following error message:

Unhandled Exception: System.TypeInitializationException: The type initializer for &quot;System.Net.Sockets.Socket&quot; threw an exception. ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full at System.Net.Sockets.Socket.InitializeSockets at System.Net.Sockets.Socket..cctor

Note You do not receive the previous error messages when you use Microsoft .NET Framework v1.0.



CAUSE
When you install a protocol or a network adapter on your computer, the operating system creates a protocol binding between the network adapters and the protocols that are installed on your computer. Typically, a computer can store up to 50 protocol binding details. Therefore, if the number of protocol bindings exceeds 50, and you use the IPAddress class directly or indirectly (such as when you try to add a Web reference or when you call a Web service method), you receive the error messages that are mentioned in the &quot;Symptoms&quot; section of this article.

Notes  The operating system creates a protocol binding even for &quot;phantom&quot; (&quot;ghosted&quot;) adapters on your computer.

For additional information about phantom devices, click the following article number to view the article in the Microsoft Knowledge Base:

241257 Device Manager Does Not Display Devices Not Currently Present in Windows 2000

 To determine the number of protocol bindings on your computer, run the enum.exe file.

The following file is available for download from the Microsoft Download Center:



Download the enum.exe package now. For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.



RESOLUTION
To resolve this problem, you must reduce the number of protocol bindings on your computer to less than 50. To do this, use one of the following methods:  To remove unnecessary protocols from your computer, follow these steps:  Click Start, point to Settings, point to Network and Dial-up Connections, and then right-click any existing connection.

For example, you may right-click Local Area Connection. Click Properties, select an unused protocol, and then click Uninstall. Click Yes when you are prompted for confirmation.</li> Repeat step 1 to step 3 to remove any other unused protocols.</li></ol>

- or -</li> To remove any unnecessary network adapters on your computer, follow these steps.

Note Before you follow these steps, make sure that Device Manager displays phantom devices also.

For additional information about displaying phantom devices, click the following article number to view the article in the Microsoft Knowledge Base:

241257 Device Manager Does Not Display Devices Not Currently Present in Windows 2000

<ol> On the Windows desktop, right-click My Computer, and then click Properties.</li> Click Hardware, and then click Device Manager.</li> Expand Network adapters.</li> Right-click any unnecessary network adapters, and then click Uninstall.</li> Click OK when you are prompted for confirmation.</li> Repeat step 4 and step 5 to remove any other unnecessary network adapters.</li></ol> </li></ul>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce the Problem
<ol> Start Visual Studio .NET 2003.</li> Use either Microsoft Visual Basic .NET or Microsoft Visual C# .NET to create an ASP.NET Web Service project named TimeoutDemo. By default, the Service1.asmx file is created.</li> On the View menu, click Code.</li> Locate and then uncomment the HelloWorld Web service method.</li> On the Build menu, click Build TimeoutDemo.</li> Use either Visual Basic .NET or Visual C# .NET to add a new Console Application project named MyClient to the TimeoutDemo solution.</li> On the Project menu, click Add Web Reference. The Add Web Reference dialog box appears.</li> <li>In the URL box, type the URL of the TimeoutDemo Web service, and then press ENTER. You may notice the following error message:

There was an error downloading 'http:// / /TimeoutDemo'. The operation has timed-out.

</li> <li>At a Visual Studio .NET 2003 command prompt, run the following command:

wsdl http:// / /TimeoutDemo/Service1.asmx

You may notice the following error message:

Unhandled Exception: System.TypeInitializationException: The type initializer for &quot;System.Net.Sockets.Socket&quot; threw an exception. ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full at System.Net.Sockets.Socket.InitializeSockets at System.Net.Sockets.Socket..cctor

</li></ol>

<div class="references_section">