ReportingService2010.FireEvent(String, String, String) Metodo

Definizione

Genera un evento in base ai parametri specificati.

public:
 void FireEvent(System::String ^ EventType, System::String ^ EventData, System::String ^ SiteUrl);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/FireEvent", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)]
[System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")]
public void FireEvent (string EventType, string EventData, string SiteUrl);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/FireEvent", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)>]
[<System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)>]
[<System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")>]
member this.FireEvent : string * string * string -> unit
Public Sub FireEvent (EventType As String, EventData As String, SiteUrl As String)

Parametri

EventType
String

Nome dell'evento.

EventData
String

Dati associati all'evento.

SiteUrl
String

URL completo del sito di SharePoint.

Specificare null (Nothing in Visual Basic) per richiamare questo metodo in modalità nativa.

Attributi

Esempio

using System;  
using System.Collections.Generic;  
using System.IO;  
using System.Text;  
using System.Web;  
using System.Web.Services;  
using System.Web.Services.Protocols;  

class Sample  
{  
    static void Main(string[] args)  
    {  
        ReportingService2010 rs = new ReportingService2010();  
        rs.Url = "http://<Server Name>" +  
            "/_vti_bin/ReportServer/ReportService2010.asmx";  
        rs.Credentials =   
            System.Net.CredentialCache.DefaultCredentials;  

        string site = "http://<Server Name>";  

        // Get the subscriptions  
        Subscription[] subs =   
            rs.ListMySubscriptions(site);  

        try  
        {  
            if (subs != null)  
            {  
                // Fire the first subscription in the list  
                rs.FireEvent("TimedSubscription",   
                    subs[0].SubscriptionID, site);  
                Console.WriteLine("Event fired.");  
            }  
        }  
        catch (Exception ex)  
        {  
            Console.WriteLine(ex.Message);  
        }  
    }  
}  
Imports System  
Imports System.IO  
Imports System.Text  
Imports System.Web.Services  
Imports System.Web.Services.Protocols  

Class Sample  

    Public Shared Sub Main()  

        Dim rs As New ReportingService2010()  
        rs.Url = "http://<Server Name>" + _  
            "/_vti_bin/ReportServer/ReportService2010.asmx"  
        rs.Credentials = _  
            System.Net.CredentialCache.DefaultCredentials  

        Dim site As String = "http://<Server Name>"  

        ' Get the subscriptions  
        Dim subs As Subscription() = _  
            rs.ListSubscriptions(site)  

        Try  
            If Not (subs Is Nothing) Then  
                ' Fire the first subscription in the list  
                rs.FireEvent("TimedSubscription", subs(0).SubscriptionID, site)  
                Console.WriteLine("Event fired.")  
            End If  
        Catch ex As Exception  
            Console.WriteLine(ex.Message)  
        End Try  

    End Sub  

End Class  

Commenti

Nella tabella seguente vengono mostrate le informazioni sull'intestazione e sulle autorizzazioni relative a questa operazione.

Utilizzo intestazione SOAP (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
Autorizzazioni necessarie in modalità nativa GenerateEvents (Sistema)
Autorizzazioni necessarie per la modalità SharePoint <xref:Microsoft.SharePoint.SPBasePermissions.ManageWeb>

Questo metodo genera un'eccezione se viene specificato un rsUnsupportedParameterForModeException valore non Null per il SiteUrl parametro in modalità nativa.

Il EventType parametro viene confrontato con il set noto di eventi definiti nel file di configurazione del server di report (rsreportserver.config). Se l'evento non è nel file di configurazione del server di report, viene generata un'eccezione SOAP con un codice di errore di rsUnknownEventType. Questo metodo supporta i TimedSubscription tipi di evento e RefreshCache .

Se EventType è TimedSubscription, specificare l'ID sottoscrizione in EventData, che viene restituito da CreateSubscription o CreateDataDrivenSubscriptionCreateDataDrivenSubscription. Se EventType è RefreshCache, specificare l'ID del piano di aggiornamento della cache in EventData, che viene restituito da CreateCacheRefreshPlan.

Il FireEvent metodo non verifica o convalida i dati forniti nel EventData parametro. Qualsiasi valore stringa è valido, inclusa una stringa vuota.

Si applica a