Idioma

ReportingService2005.BatchHeaderValue Propriedade

Definição

Recebe ou define o valor (BatchHeaderValueobjeto) que representa um ID de lote único, gerado pelo sistema, para operações multimétodo na API SOAP do 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 da propriedade

O valor do cabeçalho lote.

Exemplos

Para compilar o exemplo de código a seguir, você deve consultar o WSDL do Reporting Services e importar certos namespaces. Para mais informações, veja Exemplos de Código Compilando e Executando. O exemplo de código a seguir recupera uma lista de itens na pasta Meus Relatórios do usuário e depois exclui os itens usando uma operação em lote:

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

Comentários

Você pode usar a BatchHeaderValue propriedade no cabeçalho SOAP para chamadas de serviço Web que deseja fazer em lote.

Para executar um batch, defina a BatchHeaderValue propriedade do serviço Web do Report Server para um valor igual ao ID de lote gerado quando o lote foi criado. Por exemplo, o seguinte código C# define o BatchHeaderValue serviço Web do Servidor de Relatórios para um valor igual a um ID de lote previamente criado e então executa o lote:

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

Para mais informações sobre como criar um ID de lote, veja CreateBatch método.

Aplica-se a