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

Radscheduler web service deserialization

0 Answers 67 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
host
Top achievements
Rank 1
host asked on 21 Oct 2012, 10:49 AM
Hello

I am considering the following scenario: I have working asp.net web site with radscheduler (option with webservice binding). Everything is working fine but I would like to add such scheduler to winforms application. I have been trying to consume SchedulerWebService (this is a part of asp.net page) but I have found it is json service so it is not such easy as I thought - there are deserialization problems..
Do you have any advices? My webservice method is as follows
public List<AppointmentData> GetJSONScheduler(SchedulerInfo schedulerInfo)

I am succesfully receiving appointments but I can't deserialize List<AppointmentData> from json response.
I have been trying
but I am receiving e

DataContractJsonSerializer dJSON =
new DataContractJsonSerializer(typeof(List<AppointmentData>);
List<AppointmentData> sr = (List<AppointmentData>)dJSON.ReadObject(str);
//sbResponse is taken from the stream of webrequest response
JavaScriptSerializer jscriptDeserializer = new JavaScriptSerializer();
jscriptDeserializer.RecursionLimit = 100;
List<AppointmentData> srResult = jscriptDeserializer.Deserialize<List<AppointmentData>>(sbResponse.ToString());
xceptions about root element is missing or value __type cannot be null..
I would like to avoid string manipulation with the response (replacing elements with proper types)
Or do you have easier solution for such operations?
Solution with direct access to db is unacceptable - I am performing few operations with appointments before I am returning it to the client and I would like to have such method in one place
One web service, many clients (wpf, winforms, asp.net)..

Thanks in advance
Regards

No answers yet. Maybe you can help?

Tags
Scheduler
Asked by
host
Top achievements
Rank 1
Share this question
or