Udostępnij za pośrednictwem


Metoda ReportingService2005.CreateBatch

Tworzy partia wykonuje wiele metod w ramach pojedynczej transakcji.

Przestrzeń nazw:  ReportService2005
Zestaw:  ReportService2005 (w ReportService2005.dll)

Składnia

'Deklaracja
<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
'Użycie
Dim instance As ReportingService2005
Dim returnValue As String

returnValue = instance.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 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()
[<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)>]
member CreateBatch : unit -> string 
public function CreateBatch() : String

Wartość zwracana

Typ: System.String
A ciąg unikatowo identyfikuje partia operacji.

Uwagi

W poniższej tabela przedstawiono informacje nagłówka i uprawnienia na tej operacji.

Nagłówki SOAP

(Ruch wychodzący)ServerInfoHeaderValue

Wymagane uprawnienia

Użytkownik musi być administrator bazy danych lub skonfigurowaną jako konto wykonanie instalacji nienadzorowanej.Aby uzyskać więcej informacji, zobacz temat Konto wykonania (Konfiguracja usług raportowania).

Identyfikator zwrócony przez CreateBatch Metoda jest używana do grupy lub partia kolejnych usługa sieci Web metodą wywołania.Każda metoda przetwarzać musi mieć identyfikator partia, określoną w nagłówku SOAP.Do partia metoda wywołuje przy użyciu programu Microsoft.NET Framework najpierw zestaw BatchHeaderValue właściwość klasy proxy usługi sieci Web Server raportu wartość równą BatchHeader obiekt zawierający wcześniej utworzony wsadowym identyfikator.

Przykłady

Aby skompilować ten przykład kodu, należy odwołać WSDL usług Reporting i przywozu niektórych obszarów nazw.Aby uzyskać więcej informacji, zobacz temat Compiling and Running Code Examples.Poniższy przykład kodu tworzy partia identyfikatory dwa nowe instancje wywołania metoda usługa sieci Web i wykonuje partia:

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