|
 |
 |
 |
 |
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms
of Use |
Trademarks
Article ID: 815213 - Last Review: November 14, 2003 - Revision: 1.3 BUG: Error Occurs When You Try to Add a Web Reference to a Web Service That a Proxy Server PublishesIn 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. From 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. To 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# .NETwsdl
http://wsproxyserver/WebServiceProxy/Service1.asmx?wsdl The client proxy class is saved as the Service1.cs
file.
Microsoft Visual Basic .NETwsdl /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# .NETcsc /t:library
Service1.cs Visual Basic .NETvbc /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.
This
behavior is by design. Required Proxy Server SettingsPublishing Rules of the ISA Server When It Is Installed on a Proxy ServerSet the publishing rule for the ISA server to redirect all
the incoming requests to the internal Web server. The Listener listens on port
80 and then redirects all the incoming requests to port 6789. Note You can configure your proxy server to redirect incoming requests
to any port other than port 6789. Web Site Configuration on the Internal Web ServerConfigure the default Web site to run on port 6789 on the internal
Web server. Steps to Reproduce the BehaviorCreate an ASP.NET Web Service Project on a Computer (Internal Web Server) That Is Inside a Proxy Network- Start Visual Studio .NET.
- Use Visual C# .NET or use Visual Basic .NET to create an
ASP.NET Web Service project that is named
WebServiceProxy.
By default, the Service1.asmx
file is created. - In Solution Explorer, right-click
Service1.asmx, and then click View
Code.
- Uncomment the HelloWorld Web service
method.
- On the Build menu, click Build
Solution.
- Configure the default Web site to run on port 6789.
To do this, follow these steps:
- Click Start, and then click
Run.
The Run dialog box is
displayed. - Type
Inetmgr in the Open box, and then click OK.
- In the Internet Information Services Manager window,
click your Computer Name.
- Click the Web Sites folder.
- Under the Web Sites folder, right-click the
Default Web Site folder. Click
Properties.
- On the
Default Web Site Properties dialog box, click the Web Site tab.
- In the TCP port text
box, type
6789.
- Click OK to close the Default
Web Site Properties dialog box.
- To verify that the WebServiceProxy Web service is working
correctly, use your Web browser to visit the following URL:
http://internalwebserver:6789/WebServiceProxy/Service1.asmx Note In this URL, internalwebserver is a
placeholder for the name of your internal Web server.
Create an ASP.NET Web Application Project on a Computer That Is Outside the Proxy Server- 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.
- On the Build menu, click Build
Solution.
Add a Web Reference to the Web Service- In Solution Explorer, right-click
References, and then click Add Web Reference.
The Add Web Reference dialog box is
displayed. - Type
http://wsproxyserver/WebServiceProxy/Service1.asmx
in the Address box, and then click
Go.
- When the proxy server prompts you for authentication
credentials, type your UserName
and type your Password in the
corresponding text boxes.
You receive the error message that is mentioned in the
"Symptoms" section of this article.
Note If the IP address in the error message contains the port number
of the internal Web server, configure the publishing properties of the ISA
server to display the IP address of the proxy server instead of displaying the
IP address of the internal Web server.
For additional information, click the following article numbers to view the
articles in the Microsoft Knowledge Base: 308359Â
(http://kbalertz.com/Feedback.aspx?kbNumber=308359/
)
HOW TO: Write a Simple Web Service by Using Visual C# .NET
313072 Â
(http://kbalertz.com/Feedback.aspx?kbNumber=313072/
)
HOW TO: Configure the Web Publishing Service to Work with Internet Security and Acceleration Server in Windows 2000
APPLIES TO- Microsoft ASP.NET 1.1
- Microsoft ASP.NET 1.0
| kbip kberrmsg kbdll kbwebservices kbprb KB815213 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
|
 |
 |
 |
 |
 |
 |
 |
| |