ReportExecutionService.ServerInfoHeaderValue 属性

定义

返回有关报表服务器的信息。

public:
 property ReportExecution2005::ServerInfoHeader ^ ServerInfoHeaderValue { ReportExecution2005::ServerInfoHeader ^ get(); void set(ReportExecution2005::ServerInfoHeader ^ value); };
public ReportExecution2005.ServerInfoHeader ServerInfoHeaderValue { get; set; }
member this.ServerInfoHeaderValue : ReportExecution2005.ServerInfoHeader with get, set
Public Property ServerInfoHeaderValue As ServerInfoHeader

属性值

一个包含关于报表服务器的信息的 ServerInfoHeader 对象。

示例

若要编译以下代码示例,必须引用 Reporting Services WSDL 并导入某些命名空间。 有关详细信息,请参阅 编译和运行代码示例。 下面的代码示例调用 Web 服务,然后从 SOAP 标头检索服务器信息:

Imports System  
Imports myNamespace.myWebserviceReference  

Class Sample  
    Shared Sub Main()  
        ' Create proxy object and set service credentials to integrated  
        Dim rs As New ReportExecutionService()  
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials  

      ' Set the base Web service URL of the source server  
      rs.Url = "http://servername/reportserver/ReportExecution2005.asmx"  

        Try  
            ' Set the server info header   
            rs.ServerInfoHeaderValue = New ServerInfoHeader()  

            ' Make a call to the Web service  
            Dim secureMethods() = rs.ListSecureMethods()  

            ' Output the server version and edition to the console  
            Console.WriteLine("Server version: {0}", rs.ServerInfoHeaderValue.ReportServerVersionNumber)  
            Console.WriteLine("Server edition: {0}", rs.ServerInfoHeaderValue.ReportServerEdition)  

        Catch e As Exception  
            Console.WriteLine(e.Message)  
        End Try  
    End Sub 'Main  
End Class 'Sample  
using System;  
using myNameSpace.myWebServiceReference;  

class Sample  
{  
   static void Main()  
   {  
      // Create proxy object and set service credentials to integrated  
      ReportExecutionService rs = new ReportExecutionService();  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;  

      // Set the base Web service URL of the source server  
      rs.Url = "http://servername/reportserver/ReportExecution2005.asmx";  

      try  
      {  
         // Set the server info header   
         rs.ServerInfoHeaderValue = new ServerInfoHeader();  

         // Make a call to the Web service  
         string secureMethods[] = rs.ListSecureMethods();  

         // Output the server version and edition to the console  
         Console.WriteLine("Server version: {0}",   
            rs.ServerInfoHeaderValue.ReportServerVersionNumber);  
         Console.WriteLine("Server edition: {0}",   
            rs.ServerInfoHeaderValue.ReportServerEdition);  
      }  

      catch (Exception e)  
      {  
         Console.WriteLine(e.Message);  
      }  
   }  
}  

注解

可以使用 ServerInfoHeaderValue 此属性返回的对象来获取服务器版本和版本号。

适用于