Importer.Imprt from featureactivated function

Feb 27, 2014 at 10:09 AM
Hi

i am trying to import a ddwx file while activating a feature. But when calling from feature activated function i get aynchrounous error as below:
Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.
So i call it within a SPLongOperation which gets me past the above error but i get a the following errors in the importer.Results.Actions array:
System.Net.WebException: The operation has timed out\r\n   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)\r\n   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)\r\n   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)\r\n   at Microsoft.PerformancePoint.Scorecards.BIMonitoringAuthoringServiceProxy.GetListItems(String listUrl)\r\n   at Microsoft.PerformancePoint.Importer.GetServerElements(DoWorkEventArgs e)"


"System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\r\nParameter name: Timeout can be only be set to 'System.Threading.Timeout.Infinite' or a value > 0.\r\n   at System.Net.Sockets.NetworkStream.set_ReadTimeout(Int32 value)\r\n   at System.Net.PooledStream.set_ReadTimeout(Int32 value)\r\n   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)\r\n   --- End of inner exception stack trace ---\r\n   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)\r\n   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)\r\n   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)\r\n   at Microsoft.PerformancePoint.Scorecards.BIMonitoringAuthoringServiceProxy.GetListItems(String listUrl)\r\n   at Microsoft.PerformancePoint.Importer.GetServerElements(DoWorkEventArgs e)"

"System.InvalidOperationException: There was an error generating the XML document. ---> System.Net.WebException: The request was aborted: The request was canceled.\r\n   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)\r\n   at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)\r\n   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)\r\n   at System.IO.StreamWriter.Write(String value)\r\n   at System.Xml.XmlTextWriter.WriteStartElement(String prefix, String localName, String ns)\r\n   at System.Xml.Serialization.XmlSerializationWriter.WriteStartElement(String name, String ns, Object o, Boolean writePrefixed, XmlSerializerNamespaces xmlns)\r\n   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBIMonitoringAuthoringServiceProxy.Write24_DataColumnMapping(String n, String ns, DataColumnMapping o, Boolean isNullable, Boolean needType)\r\n   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBIMonitoringAuthoringServiceProxy.Write26_DataTableMapping(String n, String ns, DataTableMapping o, Boolean isNullable, Boolean needType)\r\n   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBIMonitoringAuthoringServiceProxy.Write27_DataSource(String n, String ns, DataSource o, Boolean isNullable, Boolean needType)\r\n   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBIMonitoringAuthoringServiceProxy.Write173_CreateDataSource(Object[] p)\r\n   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer56.Serialize(Object objectToSerialize, XmlSerializationWriter writer)\r\n   at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.PerformancePoint.Scorecards.DesignerPlugins.Utilities.GeneralUtilities.ThrowIfNotWebServiceException(Exception ex)\r\n   at Microsoft.PerformancePoint.Importer.HandleExceptionFromAuthoringService(ImportResults results, Boolean create, FirstClassElement element, Exception ex)\r\n   at Microsoft.PerformancePoint.Importer.ImportDataSources(DoWorkEventArgs e)\r\n   at Microsoft.PerformancePoint.Importer.importWorker_DoWork(Object sender, DoWorkEventArgs e)"
And so no items from ddwx file gets deployed.

But if i call the exe directly from the featureactivated code, the ddwx file is properly deployed.

Any help much appreciated.

thanks
deepthi