ReportingService2005.CancelBatch 메서드

정의

CreateBatch() 메서드 호출로 시작된 일괄 처리를 취소합니다.

public:
 void CancelBatch();
public void CancelBatch ();
member this.CancelBatch : unit -> unit
Public Sub CancelBatch ()

예제

이 코드 예제를 컴파일하려면 Reporting Services WSDL(웹 서비스 설명 언어)을 참조하고 특정 네임스페이스를 가져와야 합니다. 자세한 내용은 코드 예제 컴파일 및 실행을 참조하세요. 다음 코드 예제에서는 일괄 처리를 취소하고 실행을 시도하며 오류 세부 정보를 표시합니다.

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

설명

다음 표에서는 이 작업에 대한 헤더 및 사용 권한 정보를 보여 줍니다.

SOAP 헤더 (In) BatchHeaderValue

(Out) ServerInfoHeaderValue
필요한 권한 사용자는 데이터베이스 관리자이거나 무인 실행 계정으로 구성된 사용자여야 합니다. 자세한 내용은 실행 계정(SSRS 기본 모드)을 참조하세요.

메서드를 호출하기 전에 취소하려는 일괄 처리의 ID를 CancelBatch 지정해야 합니다. 이 작업은 보고서 서버 웹 서비스의 속성을 일괄 처리를 만들 때 생성된 일괄 처리 ID와 동일한 값으로 설정 BatchHeaderValue 하여 수행할 수 있습니다.

메서드가 CancelBatch 호출되면 일괄 처리 ID와 연결된 메서드 호출을 더 이상 실행할 수 없습니다. 취소된 일괄 처리 ID를 사용하여 일괄 처리를 실행하려고 시도하면 오류 코드 rsBatchNotFound가 인 SOAP 예외가 발생합니다.

적용 대상

추가 정보