ReportingService2010.FireEvent(String, String, String) ReportingService2010.FireEvent(String, String, String) ReportingService2010.FireEvent(String, String, String) Method

定义

基于提供的参数引发事件。 Raises an event based on the supplied parameters.

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);
Public Sub FireEvent (EventType As String, EventData As String, SiteUrl As String)
参数
EventType
String String String

事件的名称。 The name of the event.

EventData
String String String

与事件关联的数据。 The data that is associated with the event.

SiteUrl
String String String

SharePoint 站点的完全限定 URL。 The fully qualified URL for the SharePoint site. 指定null(Nothing在 Visual Basic 中) 时调用此方法在纯模式下。 Specify null (Nothing in Visual Basic) when invoking this method in Native mode.

示例

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  

注解

下表显示了有关此操作的标头和权限信息。The table below shows header and permissions information on this operation.

SOAP 标头使用情况SOAP Header Usage (In) TrustedUserHeaderValue(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue
纯模式所需的权限Native Mode Required Permissions GenerateEvents (系统)GenerateEvents (System)
SharePoint 模式所需的权限SharePoint Mode Required Permissions ManageWeb

此方法将引发rsUnsupportedParameterForModeException异常如果非 null 值指定为SiteUrl在纯模式下的参数。This method throws an rsUnsupportedParameterForModeException exception if a non-null value is specified for the SiteUrl parameter in Native mode.

EventType在报表服务器配置文件 (rsreportserver.config) 中定义的事件的一组已知匹配参数。The EventType parameter is matched against the known set of events that are defined in the report server configuration file (rsreportserver.config). 如果事件不是报表服务器配置文件,其中的包含错误代码引发一个 SOAP 异常rsUnknownEventTypeIf the event is not in the report server configuration file, a SOAP exception is thrown with an error code of rsUnknownEventType. 此方法支持TimedSubscriptionRefreshCache事件类型。This method supports the TimedSubscription and RefreshCache event types.

如果EventTypeTimedSubscription,指定中的订阅 ID EventData,通过返回的这CreateSubscriptionCreateDataDrivenSubscriptionCreateDataDrivenSubscriptionIf EventType is TimedSubscription, specify the subscription ID in EventData, which is returned by CreateSubscription or CreateDataDrivenSubscription or CreateDataDrivenSubscription. 如果EventTypeRefreshCache,指定中的缓存刷新计划 ID EventData,通过返回的这CreateCacheRefreshPlanIf EventType is RefreshCache, specify the cache refresh plan ID in EventData, which is returned by CreateCacheRefreshPlan.

FireEvent方法不会验证或验证中提供的数据EventData参数。The FireEvent method does not verify or validate the data supplied in the EventData parameter. 任何字符串值为有效包括空字符串。Any string value is valid including an empty string.

适用于