ReportingService2005.BatchHeaderValue Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece el valor (BatchHeaderValue objeto) que representa un identificador de lote único generado por el sistema para las operaciones de varios métodos 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
Valor del encabezado por lotes.
Ejemplos
Para compilar el ejemplo de código siguiente, debe hacer referencia al Reporting Services WSDL e importar determinados espacios de nombres. Para obtener más información, vea Compilar y ejecutar ejemplos de código. En el ejemplo de código siguiente se recupera una lista de elementos de la carpeta Mis informes de un usuario y, a continuación, se eliminan 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
Puede usar la BatchHeaderValue propiedad en el encabezado SOAP para las llamadas de servicio web que desea procesar por lotes.
Para ejecutar un lote, establezca la BatchHeaderValue propiedad del servicio web del servidor de informes en un valor que sea igual al identificador de lote generado cuando se creó el lote. Por ejemplo, el código de C# siguiente establece el BatchHeaderValue del servicio web del servidor de informes en un valor que es igual a un identificador de lote creado anteriormente y, a continuación, ejecuta el lote:
rs.BatchHeaderValue = bh;
rs.ExecuteBatch();
Para obtener más información sobre cómo crear un identificador de lote, consulte CreateBatch el método .