
Adding the Proxy Using the WSDL Tool
The .NET Framework SDK includes the Web Services Description Language tool (Wsdl.exe), which enables you to generate a Web service proxy for use in the .NET Framework development environment. The most common way to create a client proxy in languages that support Web services (currently C# and Microsoft Visual Basic) is to use the WSDL tool.
To add a proxy class to your project using Wsdl.exe
-
From a command prompt, use Wsdl.exe to create a proxy class, specifying (at a minimum) the URL to the Report Server Web service.
For example, the following command prompt statement specifies a URL for the management endpoint of the Report Server Web service:
wsdl /language:CS /n:"Microsoft.SqlServer.ReportingServices2005" http://<Server Name>/reportserver/reportservice2005.asmx?wsdl
The WSDL tool accepts a number of command-prompt arguments for generating a proxy. The preceding example specifies the language C#, a suggested namespace to use in the proxy (to prevent name collision if using more than one Web service endpoint), and generates a C# file called ReportingService2005.cs. If the example had specified Visual Basic, the example would have generated a proxy file with the name ReportingService2005.vb. This file is created in the directory from which you run the command.
-
Compile the proxy class into an assembly file (with the extension .dll) and reference it in your project, or add the class as a project item.
Note: |
|---|
|
When you add a proxy class to your project manually, you need to add a reference to System.Web.Services.dll. If you add the proxy using a Web reference in Visual Studio .NET, the reference is automatically created for you. For more information, see "Adding the Proxy Using a Web Reference in Visual Studio" later in this topic.
|
After you add the proxy class as an item to your project, the associated file appears in Solution Explorer.
-
To call the service programmatically, create an instance of the proxy class.
The following code example shows the syntax for creating an instance of the ReportingService2005 proxy class in a project:
Dim service As New ReportingService2005()
ReportingService2005 service = new ReportingService2005();
For more information about the Wsdl.exe tool, including its full syntax, see "Web Services Description Language Tool" in the .NET Framework SDK documentation. For a full explanation of Web service proxies, see "Creating an XML Web Service Proxy" in the .NET Framework SDK documentation.
Note: |
|---|
|
For backwards compatibility purposes, the Web service provided with Microsoft SQL Server 2000 Reporting Services is still provided. It can be accessed using the URL "http://myserver/reportserver/reportservice.asmx?wsdl".
|