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

Radscheduler web service deserialization

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

I am considering the following scenario: I have working 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 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,

Thanks in advance

No answers yet. Maybe you can help?

Asked by
Top achievements
Rank 1
Share this question