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

[Solved] JSON Serialization?

1 Answer 321 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 22 Aug 2009, 07:50 PM
I am trying to implement the WCF sample into a web application project. I am using the exact XML provider, WCF service, and XML data file in your example (http://demos.telerik.com/aspnet-ajax/scheduler/examples/wcf/defaultcs.aspx).

Can someone help me with the source of this error? It seems to be a JSON issue.

When I set ResourcePopulationMode="ClientSide", I get a javascript error stating "Line: 5568 Error: 'undefined' is null or not an object."

When I set ResourcePopulationMode="ServerSide", I get a server error stating "Operation is not valid due to the current state of the object. " This is the last part of the stack trace:

System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2 dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +546658 System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +71 System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +147 System.Web.Script.Serialization.ObjectConverter.ConvertObjectToType(Object o, Type type, JavaScriptSerializer serializer) +21 System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +181 System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeList(Int32 depth) +119 System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +210 System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +51 System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +37 System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(String input) +70 Telerik.Web.UI.Scheduling.ResourceDataSerializer.Deserialize(String json) +111 Telerik.Web.UI.SchedulerWebServiceClient.GetResources() +586 Telerik.Web.UI.RadScheduler.BindResourcesFromWebService() +95 Telerik.Web.UI.RadScheduler.PerformSelect() +123


I also noticed that if I remove the resources data from the XML file, no server error occurs and the client error changes to "Server method 'GetAppointments' failed."

Any help would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 26 Aug 2009, 02:33 PM
Hi Jeff,

Please find attached a sample project that shows RadScheduler using a WCF service. It's basically a stripped down version of the WCF example.

The mentioned JSON error occurs when the server does not return valid JSON, usually because a server error caused ASP.NET to return an error page.

Sincerely yours,
Dimitar Milushev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Scheduler
Asked by
Jeff
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Share this question
or