Idioma

ReportingService2010.FireEvent(String, String, String) Método

Definição

Levanta um evento com base nos parâmetros fornecidos.

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)

Parâmetros

EventType
String

O nome do evento.

EventData
String

Os dados associados ao evento.

SiteUrl
String

A URL totalmente qualificada para o site SharePoint.

Especifique null (Nothing no Visual Basic) ao invocar esse método no modo Nativo.

Atributos

Exemplos

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  

Comentários

A tabela abaixo mostra informações sobre cabeçalhos e permissões sobre esta operação.

Uso do Cabeçalho SOAP (Em) TrustedUserHeaderValue

(Fora) ServerInfoHeaderValue
Modo Nativo Necessário Permissões GenerateEvents (Sistema)
Permissões Necessárias no Modo SharePoint <xref:Microsoft.SharePoint.SPBasePermissions.ManageWeb>

Esse método lança uma rsUnsupportedParameterForModeException exceção se um valor não nulo for especificado para o SiteUrl parâmetro no modo Nativo.

O EventType parâmetro é comparado com o conjunto conhecido de eventos definidos no arquivo de configuração do servidor de relatórios (rsreportserver.config). Se o evento não estiver no arquivo de configuração do servidor de relatórios, uma exceção SOAP é lançada com um código de erro de rsUnknownEventType. Este método suporta os TimedSubscription tipos de evento e RefreshCache .

Se EventType for TimedSubscription, especifique o ID de assinatura em EventData, que é retornado por CreateSubscription ou CreateDataDrivenSubscription ou CreateDataDrivenSubscription. Se EventType for RefreshCache, especifique o ID do plano de atualização do cache em EventData, que é retornado por CreateCacheRefreshPlan.

O FireEvent método não verifica nem valida os dados fornecidos no EventData parâmetro. Qualquer valor de string é válido, incluindo uma string vazia.

Aplica-se a