Scheduler WebService winforms

1 posts, 0 answers
  1. Michał
    Michał avatar
    1 posts
    Member since:
    Jun 2011

    Posted 22 Oct 2012 Link to this post

    Hello

    I am considering such scenario - one web service for appointments and multi-client schedulers.
    I have created asp.net page with radscheduler and webservice binding.
    Now I am trying to use this web service for winforms scheduler (I am performing some operations in web service so solution with direct db access is unacceptable for me and I would like to have everything in one piece, in web service).
    So I am trying to get appointments from this web service - unfortunately it is JSON service so it is not so easy..
    I can't deserialize such method in forms client

    public List<AppointmentData> GetJSONScheduler(SchedulerInfo schedulerInfo)

     

    I am suceesfully invoke this method (but I have to make some modifications in JSON string before send it) and I can't deserialize return List
    I have been trying:

    DataContractJsonSerializer dJSON = new DataContractJsonSerializer(typeof(List<AppointmentData>);
     
    List<AppointmentData> sr = (List<AppointmentData>)dJSON.ReadObject(str);
     
    //str is response from HttpWebResponse
     
      
     
    JavaScriptSerializer jscriptDeserializer = new JavaScriptSerializer();
     
     jscriptDeserializer.RecursionLimit = 100;
     
     List<AppointmentData> srResult = jscriptDeserializer.Deserialize<List<AppointmentData>>(sbResponse.ToString());
     
    //sbResponse is StringBuilder made from GetResponseStream() of HttpWebResponse

     

    Do you have any advices?

    Thanks in advance
    Regards

Back to Top