Επεξεργασία

Κοινή χρήση μέσω


Calling Web Service Methods

When you use a Microsoft .NET Framework proxy class to call Web service operations, you do so by using the methods of that class. These methods respond like any other method of a class in the .NET Framework class library. All Web service methods have public access and require you to supply the appropriate number of arguments and argument types. After you have created an instance of the proxy class in your project, you can call the methods to perform reporting operations via the report server. The following C# code illustrates the use of the ListChildren method of the ReportingService2010 proxy class. The code is used to make a recursive call to the Web service that returns an array of CatalogItem objects that contains a list of all items in the report server database:

Dim rs As New ReportingService2010()  
rs.Credentials = System.Net.CredentialCache.DefaultCredentials  
Dim items As CatalogItem() = rs.ListChildren("/", True)  
ReportingService2010 rs = new ReportingService2010();  
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;  
CatalogItem[] items = rs.ListChildren("/", true);