I am parsing a JSON response from Citrix' web services. The response looks like this
[{\"webinarKey\":123456,\"subject\":\"Subject\",\"description\":\"Webinar Description. \",\"organizerKey\":123456,\"times\":[{\"startTime\":\"2012-05-08T16:00:00Z\",\"endTime\":\"2012-05-08T17:00:00Z\"}],\"timeZone\":\"America/New_York\"}]
I manually edited that string to remove identifying information, so if there is a missing quote or anything it is unrelated.
I followed the example from this answer on SO, but still am encountering an error.
Deserializing JSON result with Json & JavaScriptSerializer
public class Webinars {
public string webinarKey;
public string subject;
public string description;
public string organizerKey;
public WebinarTimes[] times;
public string timeZone;
}
public class WebinarTimes {
public string startTime;
public string endTime;
}
JavaScriptSerializer jss = new JavaScriptSerializer();
var foo = jss.Deserialize<Webinars>(JSON);
I receive the following error: Type 'Web.Site.Webinars' is not supported for deserialization of an array.
WebinarTimes is not supported for deserialization of an array.Webinarsto includeWebinarTimesas an array.