Lenguaje

ReportingService2005.BatchHeaderValue Propiedad

Definición

Obtiene o establece el valor (BatchHeaderValueobjeto) que representa un ID de lote único generado por el sistema para operaciones multimétodo en la API SOAP de Reporting Services.

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

Valor de propiedad

El valor de la cabecera por lote.

Ejemplos

Para compilar el siguiente ejemplo de código, debes consultar el WSDL de Reporting Services e importar ciertos espacios de nombres. Para más información, consulte Ejemplos de Compilación y Ejecución de Código. El siguiente ejemplo de código recupera una lista de elementos en la carpeta Mis Informes de un usuario y luego elimina los elementos mediante una operación por lotes:

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

Comentarios

Puedes usar la BatchHeaderValue propiedad en la cabecera SOAP para las llamadas a servicios web que quieras agrupar.

Para ejecutar un lote, establece la BatchHeaderValue propiedad del servicio web del Servidor de Informes a un valor igual al ID de lote generado cuando se creó el lote. Por ejemplo, el siguiente código C# establece el BatchHeaderValue valor del servicio web del Servidor de Informes a un valor igual a un ID de lote creado previamente y luego ejecuta el lote:

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

Para más información sobre cómo crear un ID de lote, véase CreateBatch método.

Se aplica a