CreateSubscription webservice API giving error when executed as a part of Batch
Hello, When I make CreateSubscription operation part of batch and then I execute batch using ExecuteBatch(), I am getting exception. If I execute CreateSubscription without batch it is working fine. I am using SSRS 2005. Is it known issue or am I missing something. Regards.Vishal
February 21st, 2011 3:39pm

Hello Jerry, Thank you for the reply. I got the exception while executing SetSubscriptionProperties in Batch too. If I execute this same function after commenting Batch related code it works fine. I am using SSRS 2005. Following is the code I am using. public void UpdateSubscription(int configurationID) { string _ssrsUrl = SSRSInfo.Url; using (Impersonator _impersonate = new Impersonator(SSRSInfo.UserName, SSRSInfo.DomainName, SSRSInfo.Password)) { ReportingService2005 _reportingServices2005 = null; try { //This will get updated destination from our application's database. string newDestination = DALHelper.GetRecordsByField<SXALABReportingConfiguration>("RptConfigurationID", configurationID).FirstOrDefault().ConfigDestination; //This will get subscriptionIDs from our database for updated destination which is to be updated on SSRS. (We store subscriptionID while we create subscription in our database.) List<SXALABReportingScheduleDeliveryConfigXREF> scheduleDelconfigXrefList = DALHelper.GetRecordsByField<SXALABReportingScheduleDeliveryConfigXREF>("RptConfigurationID", configurationID).ToList(); if (scheduleDelconfigXrefList != null && scheduleDelconfigXrefList.Count > 0) { _reportingServices2005 = new ReportingService2005(_ssrsUrl); _reportingServices2005.Credentials = System.Net.CredentialCache.DefaultCredentials; BatchHeader bh1 = new BatchHeader(); bh1.BatchID = _reportingServices2005.CreateBatch();//Create Batch to update all subscription with this destination. _reportingServices2005.BatchHeaderValue = bh1; foreach (SXALABReportingScheduleDeliveryConfigXREF scheduleDelconfigXref in scheduleDelconfigXrefList) { ActiveState active = new ActiveState(); string status = string.Empty; ParameterValue[] parameters = new ParameterValue[8]; ExtensionSettings settings = new ExtensionSettings(); string description = string.Empty; string eventTypenew = string.Empty; string matchdata = string.Empty; try { //Firstly get the subscription properties for a given subscriptionId _reportingServices2005.GetSubscriptionProperties(Convert.ToString(scheduleDelconfigXref.SubscriptionID), out settings, out description, out active, out status, out eventTypenew, out matchdata, out parameters); //Now update destination ((settings.ParameterValues[0]) as ParameterValue).Value = newDestination; //Update subscription on SSRS with this updated destination _reportingServices2005.SetSubscriptionProperties(Convert.ToString(scheduleDelconfigXref.SubscriptionID), settings, description, eventTypenew, matchdata, parameters); } catch (SoapException ex) { LogHelper.LogInformation(TraceLevel.Error, ex.Detail.InnerXml.ToString()); throw ex; } } //Execute Batch and update all subscriptions in batch _reportingServices2005.ExecuteBatch(); } } catch (Exception ex) { LogHelper.LogInformation(TraceLevel.Error, ex); ReportingApplicationException reportingEx = new ReportingApplicationException(Constants.InternalErrorMsg, ex); throw reportingEx; } finally { if (_reportingServices2005 != null) { _reportingServices2005.BatchHeaderValue = null; _reportingServices2005.Dispose(); } } } } Following is the Exception I am getting. System.Web.Services.Protocols.SoapException: A subscription delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.DeliveryErrorException: A subscription delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidExtensionParameter: One of the extension parameters is not valid for the following reason: The required setting TO was not found. at Microsoft.ReportingServices.Library.SubscriptionManager.ValidateExtensionSettingsData(SubscriptionImpl subscription) --- End of inner exception stack trace --- at Microsoft.ReportingServices.Library.SubscriptionManager.ValidateExtensionSettingsData(SubscriptionImpl subscription) at Microsoft.ReportingServices.Library.SubscriptionManager.SetSubscriptionProperties(Guid id, String eventType, String matchData, ExtensionSettings extensionSettings, String description, ParameterValueOrFieldReference[] parameters, DataRetrievalPlan dataSettings) at Microsoft.ReportingServices.Library.SetSubscriptionPropertiesAction.PerformActionNow() at Microsoft.ReportingServices.Library.SetSubscriptionPropertiesAction.PerformActionInBatch(CallParameters parameters) at Microsoft.ReportingServices.Library.RSService.ExecuteBatch(Guid batchId) at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.ExecuteBatch() --- End of inner exception stack trace --- at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.ExecuteBatch() at Microsoft.ReportingServices.WebServer.ReportingService2005.ExecuteBatch() Am I missing something while executing these methods in batch? And can we execute Get methods (like GetSubscriptionProperties) in batch? And If yes when they will be executed? Or we should execute GetSubscriptionProperties methods out of batch and then we should use values given by them and then we should execute all SetSubscriptionProperties in batch? Please also check following link from Microsoft Connect. http://connect.microsoft.com/SQLServer/feedback/details/332405/reportingservice2005-setsubscriptionproperties-fails-when-executed-as-part-of-batch Regards. Vishal
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2011 10:30am

Hello Jerry, Thank you for the reply. I got the exception while executing SetSubscriptionProperties in Batch too. If I execute this same function after commenting Batch related code it works fine. Following is the code I am using. public void UpdateSubscription(int configurationID) { string _ssrsUrl = SSRSInfo.Url; using (Impersonator _impersonate = new Impersonator(SSRSInfo.UserName, SSRSInfo.DomainName, SSRSInfo.Password)) { ReportingService2005 _reportingServices2005 = null; try { //This will get updated destination from our application's database. string newDestination = DALHelper.GetRecordsByField<SXALABReportingConfiguration>("RptConfigurationID", configurationID).FirstOrDefault().ConfigDestination; //This will get subscriptionIDs from our database for updated destination which is to be updated on SSRS. (We store subscriptionID while we create subscription in our database.) List<SXALABReportingScheduleDeliveryConfigXREF> scheduleDelconfigXrefList = DALHelper.GetRecordsByField<SXALABReportingScheduleDeliveryConfigXREF>("RptConfigurationID", configurationID).ToList(); if (scheduleDelconfigXrefList != null && scheduleDelconfigXrefList.Count > 0) { _reportingServices2005 = new ReportingService2005(_ssrsUrl); _reportingServices2005.Credentials = System.Net.CredentialCache.DefaultCredentials; BatchHeader bh1 = new BatchHeader(); bh1.BatchID = _reportingServices2005.CreateBatch();//Create Batch to update all subscription with this destination. _reportingServices2005.BatchHeaderValue = bh1; foreach (SXALABReportingScheduleDeliveryConfigXREF scheduleDelconfigXref in scheduleDelconfigXrefList) { ActiveState active = new ActiveState(); string status = string.Empty; ParameterValue[] parameters = new ParameterValue[8]; ExtensionSettings settings = new ExtensionSettings(); string description = string.Empty; string eventTypenew = string.Empty; string matchdata = string.Empty; try { //Firstly get the subscription properties for a given subscriptionId _reportingServices2005.GetSubscriptionProperties(Convert.ToString(scheduleDelconfigXref.SubscriptionID), out settings, out description, out active, out status, out eventTypenew, out matchdata, out parameters); //Now update destination ((settings.ParameterValues[0]) as ParameterValue).Value = newDestination; //Update subscription on SSRS with this updated destination _reportingServices2005.SetSubscriptionProperties(Convert.ToString(scheduleDelconfigXref.SubscriptionID), settings, description, eventTypenew, matchdata, parameters); } catch (SoapException ex) { LogHelper.LogInformation(TraceLevel.Error, ex.Detail.InnerXml.ToString()); throw ex; } } //Execute Batch and update all subscriptions in batch _reportingServices2005.ExecuteBatch(); } } catch (Exception ex) { LogHelper.LogInformation(TraceLevel.Error, ex); ReportingApplicationException reportingEx = new ReportingApplicationException(Constants.InternalErrorMsg, ex); throw reportingEx; } finally { if (_reportingServices2005 != null) { _reportingServices2005.BatchHeaderValue = null; _reportingServices2005.Dispose(); } } } } Following is the Exception I am getting. System.Web.Services.Protocols.SoapException: A subscription delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.DeliveryErrorException: A subscription delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidExtensionParameter: One of the extension parameters is not valid for the following reason: The required setting TO was not found. at Microsoft.ReportingServices.Library.SubscriptionManager.ValidateExtensionSettingsData(SubscriptionImpl subscription) --- End of inner exception stack trace --- at Microsoft.ReportingServices.Library.SubscriptionManager.ValidateExtensionSettingsData(SubscriptionImpl subscription) at Microsoft.ReportingServices.Library.SubscriptionManager.SetSubscriptionProperties(Guid id, String eventType, String matchData, ExtensionSettings extensionSettings, String description, ParameterValueOrFieldReference[] parameters, DataRetrievalPlan dataSettings) at Microsoft.ReportingServices.Library.SetSubscriptionPropertiesAction.PerformActionNow() at Microsoft.ReportingServices.Library.SetSubscriptionPropertiesAction.PerformActionInBatch(CallParameters parameters) at Microsoft.ReportingServices.Library.RSService.ExecuteBatch(Guid batchId) at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.ExecuteBatch() --- End of inner exception stack trace --- at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.ExecuteBatch() at Microsoft.ReportingServices.WebServer.ReportingService2005.ExecuteBatch() Am I missing something while executing these methods in batch? And can we execute Get methods (like GetSubscriptionProperties) in batch? And If yes when they will be executed? Or we should execute GetSubscriptionProperties methods out of batch and then we should use values given by them and then we should execute all SetSubscriptionProperties in batch? Please also check following link from Microsoft Connect. http://connect.microsoft.com/SQLServer/feedback/details/332405/reportingservice2005-setsubscriptionproperties-fails-when-executed-as-part-of-batch Regards. Vishal
February 22nd, 2011 6:44pm

Hi sisvis, What's the error message with the exception? Please refer to the sample code at http://social.technet.microsoft.com/Forums/en-US/sqlreportingservices/thread/0eeefb14-d6e4-498b-b01f-45ab904e224b about execute webservice api as a part of batch. thanks, Jerry
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2011 7:55pm

Hello Jerry, Thank you for the reply. I got the exception while executing SetSubscriptionProperties in Batch too. If I execute this same function after commenting Batch related code it works fine. Following is the code I am using. public void UpdateSubscription(int configurationID) { string _ssrsUrl = SSRSInfo.Url; using (Impersonator _impersonate = new Impersonator(SSRSInfo.UserName, SSRSInfo.DomainName, SSRSInfo.Password)) { ReportingService2005 _reportingServices2005 = null; try { //This will get updated destination from our application's database. string newDestination = DALHelper.GetRecordsByField<SXALABReportingConfiguration>("RptConfigurationID", configurationID).FirstOrDefault().ConfigDestination; //This will get subscriptionIDs from our database for updated destination which is to be updated on SSRS. (We store subscriptionID while we create subscription in our database.) List<SXALABReportingScheduleDeliveryConfigXREF> scheduleDelconfigXrefList = DALHelper.GetRecordsByField<SXALABReportingScheduleDeliveryConfigXREF>("RptConfigurationID", configurationID).ToList(); if (scheduleDelconfigXrefList != null && scheduleDelconfigXrefList.Count > 0) { _reportingServices2005 = new ReportingService2005(_ssrsUrl); _reportingServices2005.Credentials = System.Net.CredentialCache.DefaultCredentials; BatchHeader bh1 = new BatchHeader(); bh1.BatchID = _reportingServices2005.CreateBatch();//Create Batch to update all subscription with this destination. _reportingServices2005.BatchHeaderValue = bh1; foreach (SXALABReportingScheduleDeliveryConfigXREF scheduleDelconfigXref in scheduleDelconfigXrefList) { ActiveState active = new ActiveState(); string status = string.Empty; ParameterValue[] parameters = new ParameterValue[8]; ExtensionSettings settings = new ExtensionSettings(); string description = string.Empty; string eventTypenew = string.Empty; string matchdata = string.Empty; try { //Firstly get the subscription properties for a given subscriptionId _reportingServices2005.GetSubscriptionProperties(Convert.ToString(scheduleDelconfigXref.SubscriptionID), out settings, out description, out active, out status, out eventTypenew, out matchdata, out parameters); //Now update destination ((settings.ParameterValues[0]) as ParameterValue).Value = newDestination; //Update subscription on SSRS with this updated destination _reportingServices2005.SetSubscriptionProperties(Convert.ToString(scheduleDelconfigXref.SubscriptionID), settings, description, eventTypenew, matchdata, parameters); } catch (SoapException ex) { LogHelper.LogInformation(TraceLevel.Error, ex.Detail.InnerXml.ToString()); throw ex; } } //Execute Batch and update all subscriptions in batch _reportingServices2005.ExecuteBatch(); } } catch (Exception ex) { LogHelper.LogInformation(TraceLevel.Error, ex); ReportingApplicationException reportingEx = new ReportingApplicationException(Constants.InternalErrorMsg, ex); throw reportingEx; } finally { if (_reportingServices2005 != null) { _reportingServices2005.BatchHeaderValue = null; _reportingServices2005.Dispose(); } } } } Following is the Exception I am getting. System.Web.Services.Protocols.SoapException: A subscription delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.DeliveryErrorException: A subscription delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidExtensionParameter: One of the extension parameters is not valid for the following reason: The required setting TO was not found. at Microsoft.ReportingServices.Library.SubscriptionManager.ValidateExtensionSettingsData(SubscriptionImpl subscription) --- End of inner exception stack trace --- at Microsoft.ReportingServices.Library.SubscriptionManager.ValidateExtensionSettingsData(SubscriptionImpl subscription) at Microsoft.ReportingServices.Library.SubscriptionManager.SetSubscriptionProperties(Guid id, String eventType, String matchData, ExtensionSettings extensionSettings, String description, ParameterValueOrFieldReference[] parameters, DataRetrievalPlan dataSettings) at Microsoft.ReportingServices.Library.SetSubscriptionPropertiesAction.PerformActionNow() at Microsoft.ReportingServices.Library.SetSubscriptionPropertiesAction.PerformActionInBatch(CallParameters parameters) at Microsoft.ReportingServices.Library.RSService.ExecuteBatch(Guid batchId) at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.ExecuteBatch() --- End of inner exception stack trace --- at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.ExecuteBatch() at Microsoft.ReportingServices.WebServer.ReportingService2005.ExecuteBatch() Am I missing something while executing these methods in batch? And can we execute Get methods (like GetSubscriptionProperties) in batch? And If yes when they will be executed? Or we should execute GetSubscriptionProperties methods out of batch and then we should use values given by them and then we should execute all SetSubscriptionProperties in batch? Regards.Vishal
February 22nd, 2011 8:45pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics