ReportingService2005.BatchHeaderValue Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur nilai (BatchHeaderValue objek) yang mewakili ID batch unik yang dihasilkan sistem untuk operasi multi-metode di REPORTing Services SOAP API.
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
Nilai Properti
Nilai header batch.
Contoh
Untuk mengkompilasi contoh kode berikut, Anda harus mereferensikan Reporting Services WSDL dan mengimpor namespace tertentu. Untuk informasi selengkapnya, lihat Mengkompilasi dan Menjalankan Contoh Kode. Contoh kode berikut mengambil daftar item di folder Laporan Saya pengguna lalu menghapus item menggunakan operasi 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;
}
}
}
Keterangan
Anda dapat menggunakan BatchHeaderValue properti di header SOAP untuk panggilan layanan Web yang ingin Anda batch.
Untuk menjalankan batch, atur BatchHeaderValue properti layanan Web Server Laporan ke nilai yang sama dengan ID batch yang dihasilkan saat batch dibuat. Misalnya, kode C# berikut mengatur BatchHeaderValue layanan Web Server Laporan ke nilai yang sama dengan ID batch yang dibuat sebelumnya lalu menjalankan batch:
rs.BatchHeaderValue = bh;
rs.ExecuteBatch();
Untuk informasi selengkapnya tentang membuat ID batch, lihat CreateBatch metode .