This is a migrated thread and some comments may be shown as answers.

Issue with https and charts

1 Answer 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ronald de Bruijn
Top achievements
Rank 1
Ronald de Bruijn asked on 06 Jun 2012, 07:59 AM
Hello,

I am currently working on a Silverlight Business Application working entirely over Https. The project is hosted on Azure. I am using Q1 2011 tools and Siverlight 5.

I followed carefully the documentation and copy/pasted the web.config part as in : http://www.telerik.com/help/reporting/silverlight-enable-ssl-for-telerik-reporting-wcf-service.html 
I also enabled the Session caching for Azure and it is working fine. Now the problem is that as soon as i put a chart on my report, i am getting an error code 500. The detail is as follow :

Server Error in '/' Application.

Unable to cast object of type 'System.Text.CodePageEncoding' to type 'System.Text.Encoding'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Text.CodePageEncoding' to type 'System.Text.Encoding'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidCastException: Unable to cast object of type 'System.Text.CodePageEncoding' to type 'System.Text.Encoding'.]
   ReadInternalEncoderBestFitFallbackFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +648
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns) +109
   System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadSerializationInfo(XmlReaderDelegator xmlReader, Type type) +357
   ReadCodePageEncodingFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +144
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadRenderingStreamFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +1631
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadArrayOfRenderingStreamFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) +623
   System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +161
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadArrayOfRenderingStreamFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +358
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadReportServiceHistoryFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +820
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadArrayOfanyTypeFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) +575
   System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +161
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   ReadSerializableSessionStateStoreDataFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +764
   System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +106
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) +558
   System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns) +109
   System.Runtime.Serialization.NetDataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName) +170
   System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) +647
   System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader) +128
   Microsoft.ApplicationServer.Caching.Utility.Deserialize(Byte[][] buffers, Boolean checkTypeToLoad, Object context, IEnumerable`1 knownTypes) +684
   Microsoft.ApplicationServer.Caching.SimpleSendReceiveModule.SendMsgAndWait(EndpointID endpt, RequestBody reqMsg, TimeSpan requestTimeout, IRequestTracker& tracker) +1615
   Microsoft.ApplicationServer.Caching.HybridClient.SendMsgAndWait(RequestBody reqMsg, IRequestTracker& tracker) +188
   Microsoft.ApplicationServer.Caching.DataCache.SendReceive(RequestBody reqMsg, IMonitoringListener listener) +254
   Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg, IMonitoringListener listener) +10
   Microsoft.ApplicationServer.Caching.DataCache.InternalGetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle, String region, Boolean lockKey, IMonitoringListener listener) +227
   Microsoft.ApplicationServer.Caching.<>c__DisplayClass78.<GetAndLock>b__77() +103
   Microsoft.ApplicationServer.Caching.DataCache.GetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle) +258
   Microsoft.Web.DistributedCache.<>c__DisplayClass31`1.<PerformCacheOperation>b__30() +19
   Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action) +66
   Microsoft.Web.DistributedCache.DataCacheForwarderBase.GetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle) +190
   Microsoft.Web.DistributedCache.BlobBasedSessionStoreProvider.GetItem(HttpContextBase context, String id, Boolean acquireWriteLock, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +211
   Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +125
   System.Web.SessionState.SessionStateModule.GetSessionStateItem() +178
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1076
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +115
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 


I checked the Output window in visual studio and nothing looked wrong. The report is built but nothing is appearing in the Silverlight page.
I also tried to host the report on an asp.net webpage, and put that webpage in a RadHtmlHolder within my silverlight application. The chart were working fine when i was calling the page over http, but not over https(tables were displayed but chart were not there).

Let me know if I need to give you more information, i am stuck for a week on this problem...


UPDATE : Looks like I cannot answer the thread, I am getting an error.

->
Thank you for your answer Steve,


The Out-proc session was already set up and the reports were appearing fine, it is only when i added a chart that it stopped working.
The endpoints were also present. What i ended up doing is hosting it on a local IIS and add http and https endpoint, i also removed Out-proc session and everything worked perfectly.


Our final solution  was to use an Amazon EC2 instance, we moved all our databases and website from Azure to there. Since then the system is 6 times quicker on average and most of the workarounds necessary for Azure are not needed anymore.


Anyway thank you for your support and keep up the good work :)






1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 11 Jun 2012, 03:02 PM
Hi Ronald,

We've seen this error in the early era of Azure, when it did not support Out-proc session, however this has changed since when they have introduced ASP.NET Session State Provider. In Azure when you use multiple web roles, you have to use an out-proc session i.e. multiple roles act similar to web farm and you need common session. Adding ASP.NET Session State Provider for Windows Azure should prevent any problems with session and reports should appear consistently.

About the charts - they are served by the Telerik Reporting WCF Service, specifically make sure that the resources endpoint is present in your configuration file. Still if the problem is with the resources, then you would not be able to view images in the report as well, can you try?

Also a possible solution to try is hosting the reporting WCF service in a single instance project and use it in your multiple instance project i.e. simply change the ReportServiceUri to the absolute uri of the single instance service e.g.: ReportServiceUri="http://singleinstance.cloudapp.net/ReportService.svc".

The stacktrace you've posted below, does not indicate any Telerik involvement and as we could not find a reasonable explanation after googling for this error, we suggest you contact MS support for help as well. MS have almost no information about dealing with WCF services in Azure, so there might be something obvious in the configuration that is missing.

Regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Ronald de Bruijn
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or