Share via


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;  
      }  
   }  
}  

注釈

バッチにまとめたい Web サービス呼び出しでは、SOAP ヘッダー内で BatchHeaderValue プロパティを使用できます。

バッチを実行するには、レポート サーバー Web サービスの BatchHeaderValue プロパティに、バッチの作成時に生成されたバッチ ID の値を設定します。 たとえば、次の C# コードでは、レポート サーバー Web サービスの BatchHeaderValue に以前作成したバッチ ID と同じ値を設定した後に、バッチを実行します。

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

バッチ ID の作成方法の詳細については、CreateBatch メソッドを参照してください。

適用対象