ReportingService2005.BatchHeaderValue Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene o imposta il valore (BatchHeaderValueoggetto) che rappresenta un ID batch univoco generato dal sistema per operazioni multi-metodo nell'API SOAP di 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
Valore della proprietà
Il valore dell'intestazione batch.
Esempio
Per compilare il seguente esempio di codice, devi fare riferimento al WSDL di Reporting Services e importare determinati namespace. Per maggiori informazioni, vedi Compiling and Conducting Code Examples. Il seguente esempio di codice recupera una lista di elementi nella cartella My Reports di un utente e poi elimina gli elementi tramite un'operazione batch:
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;
}
}
}
Commenti
Puoi usare la BatchHeaderValue proprietà nell'intestazione SOAP per le chiamate di servizio Web che vuoi fare in batch.
Per eseguire un batch, si imposta la BatchHeaderValue proprietà del servizio Web del Report Server a un valore uguale all'ID del batch generato quando il batch è stato creato. Ad esempio, il seguente codice C# imposta il BatchHeaderValue servizio Web del Report Server a un valore uguale a un ID batch precedentemente creato e poi esegue il batch:
rs.BatchHeaderValue = bh;
rs.ExecuteBatch();
Per maggiori informazioni sulla creazione di un ID batch, vedi CreateBatch metodo.