Web サービスを使用してサブスクリプションを作成しようとしていますが、メソッドは例外をスローしていませんが、サブスクリプションも作成していません。
ほとんどのフォーラムとヘルプ ファイルで見た情報を検索すると、CreateSubscription メソッドはバッチ ヘッダーを要求していませんが、私はそれを要求しているので、インストールに問題がある可能性があると考えています。
これが私のコードです。
Dim rs As New reportingReference.ReportingService2005SoapClient
rs.ClientCredentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultCredentials
'rs.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation
rs.ClientCredentials.Windows.AllowedImpersonationLevel = New System.Security.Principal.TokenImpersonationLevel()
Dim batchID As String = String.Empty
Dim infoHeader As ServerInfoHeader = rs.CreateBatch(batchID)
Dim bh As BatchHeader = New BatchHeader()
bh.BatchID = batchID
bh.AnyAttr = infoHeader.AnyAttr
Dim report As String = "/reportParam1"
Dim desc As String = "Send email from code to Hisham@comsoft.com"
Dim eventType As String = "TimedSubscription"
Dim scheduleXml As String = "<ScheduleDefinition><StartDateTime>2012-03-22T09:30:00</StartDateTime><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Thursday>True</Thursday></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
'"<ScheduleDefinition><StartDateTime>2012-10-06T08:00:00-08:00</StartDateTime><WeeklyRecurrence>" & _
'"<WeeksInterval>1</WeeksInterval><DaysOfWeek><Monday>True</Monday></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>" ' "<ScheduleDefinition xmlns:xsd=\""http://www.w3.org/2001/XMLSchema\"" xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\""><StartDateTime xmlns=\""http://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices\"">2010-03-06T15:15:00.000+05:00</StartDateTime></ScheduleDefinition>"
Dim extensionParams(7) As ParameterValue
extensionParams(0) = New ParameterValue()
extensionParams(0).Name = "TO"
extensionParams(0).Value = "rocha@costarricense.cr"
extensionParams(1) = New ParameterValue()
extensionParams(1).Name = "IncludeReport"
extensionParams(1).Value = "True"
extensionParams(2) = New ParameterValue()
extensionParams(2).Name = "RenderFormat"
extensionParams(2).Value = "MHTML"
extensionParams(3) = New ParameterValue()
extensionParams(3).Name = "Subject"
extensionParams(3).Value = "@ReportName was executed at @ExecutionTime"
extensionParams(4) = New ParameterValue()
extensionParams(4).Name = "Comment"
extensionParams(4).Value = "Here is your test report for testing purpose"
'extensionParams(5) = New ParameterValue()
'extensionParams(5).Name = "IncludeLink"
'extensionParams(5).Value = "True"
extensionParams(5) = New ParameterValue()
extensionParams(5).Name = "Priority"
extensionParams(5).Value = "NORMAL"
Dim parameters(0) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "ReportParameter1"
parameters(0).Value = "ReportParameter1"
'parameters(1) = New ParameterValue()
'parameters(1).Name = "UserName"
'parameters(1).Value = "admin"
'parameters(2) = New ParameterValue()
'parameters(2).Name = "SupplierId"
'parameters(2).Value = "0"
Dim matchData As String = scheduleXml
Dim extSettings As New ExtensionSettings()
extSettings.ParameterValues = extensionParams
extSettings.Extension = "Report Server Email"
Try
Dim _sub As String = ""
Dim SubID As ServerInfoHeader = rs.CreateSubscription(bh, report, extSettings, desc, eventType, matchData, parameters, _sub)
rs.FireEvent(bh, "TimedSubscription", _sub)
Catch ex As Exception
Console.WriteLine(ex)
End Try