ReportingService2005.CreateBatch Method

Creates a batch that executes multiple methods within a single transaction.

네임스페이스: Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005
어셈블리: ReportService2005 (in reportingservice2005.dll)

구문

‘선언
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateBatch", 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 CreateBatch As String
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateBatch", 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 string CreateBatch ()
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateBatch", 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:
String^ CreateBatch ()
/** @attribute SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateBatch", 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 String CreateBatch ()
SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateBatch", 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 CreateBatch () : String

반환 값

A String that uniquely identifies a batch operation.

주의

The ID returned by the CreateBatch method is used to group or batch subsequent Web service method calls. Each method included in the batch must have the batch ID specified in the SOAP header. To batch the method calls using the Microsoft .NET Framework, you must first set the BatchHeaderValue property of the Report Server Web service proxy class to a value that is equal to that of a BatchHeader object that contains a previously created batch ID.

To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see 코드 예제 컴파일 및 실행. The following code example creates batch IDs for two new batches of Web service method calls and executes the batches:

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 bh1 As New BatchHeader()
      Dim bh2 As New BatchHeader()

      bh1.BatchID = rs.CreateBatch()
      rs.BatchHeaderValue = bh1
      rs.CreateFolder("New Folder1", "/", Nothing)
      rs.CreateFolder("New Folder2", "/", Nothing)
      rs.CreateFolder("New Folder3", "/", Nothing)

      bh2.BatchID = rs.CreateBatch()
      rs.BatchHeaderValue = bh2
      rs.DeleteItem("/New Folder1")
      rs.DeleteItem("/New Folder2")
      rs.DeleteItem("/New Folder3")

      rs.BatchHeaderValue = bh1

      ' Create folders using a batch header 1.
      Try
         rs.ExecuteBatch()
         Console.WriteLine("Folders created successfully.")

      Catch e As SoapException
         Console.WriteLine(e.Detail.InnerXml.ToString())
      End Try

      rs.BatchHeaderValue = bh2

      ' Delete folders using batch header 2.
      Try
         rs.ExecuteBatch()
         Console.WriteLine("Folders deleted successfully.")

      Catch e As SoapException
         Console.WriteLine(e.Detail.InnerXml.ToString())

      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;

      BatchHeader bh1 = new BatchHeader();
      BatchHeader bh2 = new BatchHeader();

      bh1.BatchID = rs.CreateBatch();
      rs.BatchHeaderValue = bh1;
      rs.CreateFolder("New Folder1", "/", null);
      rs.CreateFolder("New Folder2", "/", null);
      rs.CreateFolder("New Folder3", "/", null);

      bh2.BatchID = rs.CreateBatch();
      rs.BatchHeaderValue = bh2;
      rs.DeleteItem("/New Folder1");
      rs.DeleteItem("/New Folder2");
      rs.DeleteItem("/New Folder3");

      rs.BatchHeaderValue = bh1;

      // Create folders using a batch header 1.
      try
      {
         rs.ExecuteBatch();
         Console.WriteLine("Folders created successfully.");
      }

      catch (SoapException e)
      {
         Console.WriteLine(e.Detail.InnerXml.ToString());
      }

      rs.BatchHeaderValue = bh2;

      // Delete folders using batch header 2.
      try
      {
         rs.ExecuteBatch();
         Console.WriteLine("Folders deleted successfully.");
      }

      catch (SoapException e)
      {
         Console.WriteLine(e.Detail.InnerXml.ToString());
      }

      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
ReportingService2005.CancelBatch Method
ExecuteBatch

관련 자료

Batching Methods