BUG: Error Occurs When You Try to Add a Web Reference to a Web Service That a Proxy Server Publishes (815213)
The information in this article applies to:
- Microsoft ASP.NET (included with the .NET Framework 1.1)
- Microsoft ASP.NET (included with the .NET Framework) 1.0
SYMPTOMSIn an ASP.NET Web Application project, when you try to add a
Web reference to a Web service that a proxy server publishes, you may receive
an error message that is similar to the following error message. Microsoft .NET Framework 1.0Unable to download the following files from
http://<wsproxyserver>/WebService2/service1.asmx?op=HelloWorld,
http://<wsproxyserver>:6789/WebService2/service1.asmx?wsdl. Do you want to
skip these files and continue? Microsoft .NET Framework 1.1Unable to download the following file from
http://<wsproxyserver>:6789/WebService2/service1.asmx?wsdl. Do you want
to skip this file and continue? Note Throughout this article, wsproxyserver is a
placeholder for the IP address of the proxy server. CAUSEFrom a Web
client, you try to add a Web reference to a Web service so that the internal Web server is inside a proxy network.
The
Redirect port number of the proxy server is then attached to the Internet
Protocol (IP) address of the proxy server in the generated proxy class instead
of the Listener port number of the proxy server being attached to the IP
address of the proxy server in the generated proxy class.WORKAROUNDTo work around this bug, use the Web Services Description
Language tool (Wsdl.exe) to create a client proxy class and then modify the
proxy class to update the URL information with the correct port
number. To do this, follow these steps:
- Create a client proxy class.
To do this, follow
these steps:
- In Microsoft Windows Explorer, create a folder that is named
Clientproxy in the C:\ root
directory.
- At a Microsoft Visual Studio .NET command prompt,
change the directory path to the C:\Clientproxy directory.
- At the Visual Studio .NET command prompt, run the
following command.
Microsoft Visual C# .NET wsdl
http://wsproxyserver/WebServiceProxy/Service1.asmx?wsdl The client proxy class is saved as the Service1.cs
file.
Microsoft Visual Basic .NET wsdl /l:VB
http://wsproxyserver/WebServiceProxy/Service1.asmx?wsdl
The client proxy class is saved as the Service1.vb
file.
- Modify the client proxy class.
To do this, follow
these steps:
- Use Notepad to open the Service1.cs file or to open the
Service1.vb file.
The proxy URL contains the port number (6789) of
the internal Web server as follows:http://<wsproxyserver>:6789/WebServiceProxy/service1.asmx - In Visual C# .NET, modify the
Service1 method of the proxy class, and then save the
Service1 method of the proxy class, as follows:
public Service1()
{
this.Url = "http://<wsproxyserver>/WebServiceProxy/service1.asmx";
} In Visual Basic .NET, modify the New
method of the proxy class, and then save the New method of the
proxy class, as follows:Public Sub New()
MyBase.New
Me.Url = "http://<wsproxyserver>/WebServiceProxy/service1.asmx"
End Sub
- Compile the proxy class code that is stored in the
Service1.cs file or in the Service1.vb file to create the Service1.dll
assembly.
To do this, follow these steps:
- At a Visual Studio .NET command prompt, change the
directory path to the C:\Clientproxy
directory.
- At the Visual Studio .NET command prompt, run the
following command:
Visual C# .NET csc /t:library
Service1.cs Visual Basic .NET vbc /t:library
/r:System.XML.dll,System.Web.Services.dll,System.Data.dll,System.Web.dll,System.dll
Service1.vb The Service1.dll file is created.
- Create an ASP.NET Web Application project.
To do
this, follow these steps:
- Start Visual Studio .NET.
- Use Visual C# .NET or use Visual Basic .NET to create
an ASP.NET Web Application project that is named
Project1.
- In Solution Explorer, right-click Project1, and then click Add Reference.
- In the Add Reference dialog box, click
Browse.
- In the Select Component dialog box,
locate the C:\Clientproxy folder.
- Click Service1.dll, and then click
Open.
- Click OK to close the Add
Reference dialog box.
STATUS This
behavior is by design.REFERENCES
For additional information, click the following article numbers to view the
articles in the Microsoft Knowledge Base: 308359
HOW TO: Write a Simple Web Service by Using Visual C# .NET
313072 HOW TO: Configure the Web Publishing Service to Work with Internet Security and Acceleration Server in Windows 2000
Modification Type: | Major | Last Reviewed: | 11/14/2003 |
---|
Keywords: | kbIP kberrmsg kbDLL kbWebServices kbprb KB815213 kbAudDeveloper |
---|
|