ReportingService2005.BatchHeaderValue 속성

정의

Reporting Services SOAP API에서 다중 메서드 작업에 대해 시스템에서 생성된 고유한 일괄 처리 ID를 나타내는 값(BatchHeaderValue 개체)을 가져오거나 설정합니다.

public:
 property ReportService2005::BatchHeader ^ BatchHeaderValue { ReportService2005::BatchHeader ^ get(); void set(ReportService2005::BatchHeader ^ value); };
public ReportService2005.BatchHeader BatchHeaderValue { get; set; }
member this.BatchHeaderValue : ReportService2005.BatchHeader with get, set
Public Property BatchHeaderValue As BatchHeader

속성 값

일괄 처리 헤더 값입니다.

예제

다음 코드 예제를 컴파일하려면 Reporting Services WSDL을 참조하고 특정 네임스페이스를 가져와야 합니다. 자세한 내용은 코드 예제 컴파일 및 실행을 참조하세요. 다음 코드 예제에서는 사용자의 내 보고서 폴더에 있는 항목 목록을 검색한 다음 일괄 처리 작업을 사용하여 항목을 삭제합니다.

Imports System  
Imports System.Web.Services.Protocols  

Class Sample  
   Public Shared Sub Main()  
      Dim rs As New ReportingService2005()  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials  

      ' Return all items in the My Reports folder.  
      Dim items As CatalogItem() = rs.ListChildren("/My Reports", False)  

      Dim bh As New BatchHeader()  
      bh.BatchID = rs.CreateBatch()  
      rs.BatchHeaderValue = bh  

      Dim item As CatalogItem  
      For Each item In  items  
         Console.WriteLine((item.Path + " found."))  
         rs.DeleteItem(item.Path)  
         Console.WriteLine((item.Path + " deleted."))  
      Next item  

      Try  
         rs.ExecuteBatch()  
      Catch ex As SoapException  
         Console.WriteLine(ex.Message)  
      Finally  
         rs.BatchHeaderValue = Nothing  
      End Try  
   End Sub 'Main  
End Class 'Sample  
using System;  
using System.Web.Services.Protocols;  

class Sample  
{  
   public static void Main()  
   {  
      ReportingService2005 rs = new ReportingService2005();  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;  

      // Return all items in the My Reports folder.  
      CatalogItem[] items = rs.ListChildren("/My Reports", false);  

      BatchHeader bh = new BatchHeader();  
      bh.BatchID = rs.CreateBatch();  
      rs.BatchHeaderValue = bh;  

      foreach (CatalogItem item in items)  
      {  
         Console.WriteLine(item.Path + " found.");  
         rs.DeleteItem(item.Path);  
         Console.WriteLine(item.Path + " deleted.");  
      }  

      try  
      {  
         rs.ExecuteBatch();  
      }  
      catch (SoapException ex)  
      {  
         Console.WriteLine(ex.Message);  
      }  
      finally  
      {  
         rs.BatchHeaderValue = null;  
      }  
   }  
}  

설명

배치하려는 웹 서비스 호출에 대한 SOAP 헤더의 속성을 사용할 BatchHeaderValue 수 있습니다.

일괄 처리를 실행하려면 보고서 서버 웹 서비스의 속성을 일괄 처리를 만들 때 생성된 일괄 처리 ID와 같은 값으로 설정합니다 BatchHeaderValue . 예를 들어 다음 C# 코드는 보고서 서버 웹 서비스의 를 BatchHeaderValue 이전에 만든 일괄 처리 ID와 같은 값으로 설정한 다음 일괄 처리를 실행합니다.

rs.BatchHeaderValue = bh;  
rs.ExecuteBatch();  

일괄 처리 ID를 만드는 방법에 대한 자세한 내용은 메서드를 참조 CreateBatch 하세요.

적용 대상