ReportingService2005.BatchHeaderValue プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
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を参照し、特定の名前空間をインポートする必要があります。 詳細については 、「コード例のコンパイルと実行」をご覧ください。 以下のコード例は、ユーザーの「My Reports」フォルダ内のアイテムリストを取得し、バッチ操作でそれらを削除します。
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 プロパティを使い、まとめたいWebサービス呼び出しに使うことができます。
バッチを実行するには、Report Server Webサービスの BatchHeaderValue プロパティを、バッチ作成時に生成されたバッチIDと等しい値に設定します。 例えば、以下のC#コードは、レポートサーバーWebサービスの BatchHeaderValue を、以前に作成されたバッチIDと等しい値に設定し、そのバッチを実行します。
rs.BatchHeaderValue = bh;
rs.ExecuteBatch();
バッチIDの作成についての詳細は CreateBatch メソッドをご覧ください。