BatchHeaderValue Property
Collapse the table of content
Expand the table of content

BatchHeaderValue Property

SQL Server 2000

ReportingService.BatchHeaderValue Property

The value (BatchHeader object) that represents a unique, system-generated batch ID for multi-method operations in the Reporting Services SOAP API.

public Dim BatchHeaderValue As [Namespace].BatchHeader
   Member of [Namespace].ReportingService

public [Namespace].BatchHeader BatchHeaderValue;
   Member of [Namespace].ReportingService

You can use the BatchHeaderValue property in the SOAP header for Web service calls that you want to batch.

To execute a batch, set the BatchHeaderValue property of the Web service to a value that is equal to the batch ID generated when the batch was created. For example, the following C# code sets the BatchHeaderValue of the Web service to a value that is equal to a previously created batch ID and then executes the batch:

rs.BatchHeaderValue = bh;

For more information about creating a batch ID, see CreateBatch Method.


To compile the following code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see Compiling and Running Code Examples. The following code example retrieves a list of items in a user's My Reports folder and then deletes the items using a batch operation:

Imports System
Imports System.Web.Services.Protocols

Class Sample
   Public Shared Sub Main()
      Dim rs As New ReportingService()
      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."))
         Console.WriteLine((item.Path + " deleted."))
      Next item
      Catch ex As SoapException
         rs.BatchHeaderValue = Nothing
      End Try
   End Sub 'Main
End Class 'Sample

using System;
using System.Web.Services.Protocols;

class Sample
   public static void Main()
      ReportingService rs = new ReportingService();
      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.");
         Console.WriteLine(item.Path + " deleted.");

      catch (SoapException ex)
         rs.BatchHeaderValue = null;
See Also

ReportingService Class

Reporting Services Web Service Library

© 2015 Microsoft