ReportingService2005.CancelBatch Method
Cancels the batch that was initiated by a call to the CreateBatch method.
命名空间: Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005
程序集: ReportService2005 (in reportingservice2005.dll)
语法
声明
<SoapHeaderAttribute("BatchHeaderValue")> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CancelBatch", RequestNamespace:="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace:="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction:=SoapHeaderDirection.Out)> _
Public Sub CancelBatch
[SoapHeaderAttribute("BatchHeaderValue")]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CancelBatch", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out)]
public void CancelBatch ()
[SoapHeaderAttribute(L"BatchHeaderValue")]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CancelBatch", RequestNamespace=L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace=L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse::Literal, ParameterStyle=SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction=SoapHeaderDirection::Out)]
public:
void CancelBatch ()
/** @attribute SoapHeaderAttribute("BatchHeaderValue") */
/** @attribute SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CancelBatch", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped) */
/** @attribute SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out) */
public void CancelBatch ()
SoapHeaderAttribute("BatchHeaderValue")
SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CancelBatch", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)
SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out)
public function CancelBatch ()
备注
You must specify the ID of the batch that you want to cancel before calling the CancelBatch method. You can do this by setting the BatchHeaderValue property of the Report Server Web service to a value equal to the batch ID that was generated when the batch was created.
When the CancelBatch method is called, any method calls that are associated with the batch ID can no longer be executed. Any attempt to execute a batch with a cancelled batch ID results in a SOAP exception with the error code rsBatchNotFound.
示例
To compile this code example, you must reference the Reporting Services Web Service Description Language (WSDL) and import certain namespaces. For more information, see 编译和运行代码示例. The following code example cancels a batch, attempts to execute it, and displays error details:
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim bh As New BatchHeader()
bh.BatchID = rs.CreateBatch()
rs.BatchHeaderValue = bh
rs.CreateFolder("New Folder1", "/", Nothing)
rs.CreateFolder("New Folder2", "/", Nothing)
rs.CreateFolder("New Folder3", "/", Nothing)
Console.WriteLine("Cancelling current batch operation.")
' Cancel the current batch.
Try
rs.CancelBatch()
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
End Try
Try
' Generates an error because the batch has already been cancelled.
rs.ExecuteBatch()
Console.WriteLine("The batch executed successfully.")
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
Console.WriteLine("The batch was not executed.")
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()
{
ReportingService rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
BatchHeader bh = new BatchHeader();
bh.BatchID = rs.CreateBatch();
rs.BatchHeaderValue = bh;
rs.CreateFolder("New Folder1", "/", null);
rs.CreateFolder("New Folder2", "/", null);
rs.CreateFolder("New Folder3", "/", null);
Console.WriteLine("Cancelling current batch operation.");
// Cancel the current batch.
try
{
rs.CancelBatch();
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
}
try
{
// Generates an error because the batch has already been cancelled.
rs.ExecuteBatch();
Console.WriteLine("The batch executed successfully.");
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
Console.WriteLine("The batch was not executed.");
}
finally
{
rs.BatchHeaderValue = null;
}
}
}
线程安全
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
平台
开发平台
有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。
目标平台
有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。
请参阅
参考
ReportingService2005 Class
ReportingService2005 Members
Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005 Namespace
ExecuteBatch