Linguaggio

ReportingService2010.FireEvent(String, String, String) Metodo

Definizione

Genera un evento basato sui parametri forniti.

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

I dati associati all'evento.

SiteUrl
String

L'URL completamente qualificato per il sito SharePoint.

Specifica null (Nothing in Visual Basic) quando invochi 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

La tabella sottostante mostra informazioni sull'intestazione e sui permessi di questa operazione.

Utilizzo dell'intestazione SOAP (Dentro) TrustedUserHeaderValue

(Fuori) ServerInfoHeaderValue
Permessi richiesti per la modalità nativa GenerateEvents (Sistema)
Permessi richiesti in modalità SharePoint <xref:Microsoft.SharePoint.SPBasePermissions.ManageWeb>

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

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

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

Il FireEvent metodo non verifica né valida i dati forniti nel EventData parametro. Qualsiasi valore di stringa è valido, inclusa una stringa vuota.

Si applica a