GetProperties 메서드에 대한 항목 네임스페이스 설정Setting the Item Namespace for the GetProperties Method

Reporting ServicesReporting Services에서 ItemNamespaceHeader SOAP 헤더를 사용하여 서로 다른 항목 식별자인 항목의 전체 경로 또는 항목의 ID를 기준으로 항목 속성을 검색할 수 있습니다.You can use the ItemNamespaceHeader SOAP header in Reporting ServicesReporting Services to retrieve item properties based on two different item identifiers: the full path of the item or the ID of the item.

GetProperties 메서드를 호출할 때 일반적으로 속성을 검색하려는 항목의 전체 경로를 인수로 전달합니다.When you make a call to the GetProperties method, you normally pass as an argument the full path of the item for which you want to retrieve properties. ItemNamespaceHeader를 사용하여 메서드 호출에 대해 SOAP 헤더를 설정하면 항목의 ID를 식별자로 전달하여 GetProperties를 사용할 수 있습니다.By using ItemNamespaceHeader, you can set the SOAP header for your method call to enable you to use GetProperties by passing the ID of the item as an identifier.

다음 코드 예제에서는 항목의 ID를 기준으로 항목 속성에 대한 값을 검색합니다.The following code sample retrieves the values for item properties based on the ID of the item.

참고

기본적으로 ItemNamespaceHeader 메서드에 전체 경로 이름을 항목 식별자로 전달하는 경우 GetProperties에 대한 값을 설정할 필요가 없습니다.By default, you do not need to set a value for the ItemNamespaceHeader if you pass to the GetProperties method the full path name as the item identifier.

Imports System  
Imports System.Collections  

Class Sample  
   Sub Main()  
      Dim rs As New ReportingService2010()  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials  
      rs.Url = "http://<Server Name>/reportserver/ReportService2010.asmx"  

      Dim items() As CatalogItem  

      Try  
         ' Need the ID property of items. Normally, you would already have   
         ' this stored somewhere.  
         items = rs.ListChildren("/AdventureWorks Sample Reports", False)  

         ' Set the item namespace header to be GUID-based  
         rs.ItemNamespaceHeaderValue = New ItemNamespaceHeader()  
         rs.ItemNamespaceHeaderValue.ItemNamespace = ItemNamespaceEnum.GUIDBased  

         ' Call GetProperties with item ID.  
         If Not (items Is Nothing) Then  
            Dim item As CatalogItem  
            For Each item In  items  
               Dim properties As [Property]() = rs.GetProperties(item.ID, Nothing)  
               Dim property As [Property]  
               For Each property In  properties  
                  Console.WriteLine(([property].Name + ": " + [property].Value))  
               Next property  
               Console.WriteLine()  
            Next item  
         End If  

      Catch e As Exception  
         Console.WriteLine((e.Message + ": " + e.StackTrace))  
      End Try  
   End Sub 'Main  
End Class 'Sample  
using System;  
using System.Collections;  

class Sample  
{  
   static void Main()  
   {  
   ReportingService2010 rs = new ReportingService2010();  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;  
      rs.Url = "http://<Server Name>/reportserver/ReportService2010.asmx";  

      CatalogItem[] items;  

      try  
      {  
         // Need the ID property of items. Normally, you would already have   
         // this stored somewhere.  
         items = rs.ListChildren("/AdventureWorks Sample Reports", false);  

         // Set the item namespace header to be GUID-based  
         rs.ItemNamespaceHeaderValue = new ItemNamespaceHeader();  
         rs.ItemNamespaceHeaderValue.ItemNamespace = ItemNamespaceEnum.GUIDBased;  

         // Call GetProperties with item ID.  
         if (items != null)  
         {  
            foreach( CatalogItem item in items)  
            {  
               Property[] properties = rs.GetProperties(item.ID, null);  
               foreach (Property property in properties)  
               {  
                  Console.WriteLine(property.Name + ": " + property.Value);  
               }  
               Console.WriteLine();  
            }  
         }  
      }  

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

관련 항목:See Also

기술 참조 ( Ssrs) Technical Reference (SSRS)
보고를 사용 하 여 Services SOAP 헤더Using Reporting Services SOAP Headers