/// <summary> /// Execution Logic /// </summary> protected override void Execute(CodeActivityContext context) { try { MembersCount.Set(context, 0); MembersNames.Set(context, new Collection <string>() { }); string host = "https://api.meetup.com/2/rsvps?event_id={0}&sign=true&key={1}"; string url = string.Format(host, EventID.Get(context), ApiKey.Get(context)); string response = string.Empty; HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; if (null == request) { throw new ApplicationException("HttpWebRequest failed"); } using (StreamReader sr = new StreamReader(request.GetResponse().GetResponseStream())) { response = sr.ReadToEnd(); } RawResponse.Set(context, response); Collection <string> names = new Collection <string>() { }; JObject o = JObject.Parse(response); JArray a = (JArray)o["results"]; foreach (JToken item in a) { names.Add(item["member"]["name"].ToString()); } MembersCount.Set(context, a.Count); MembersNames.Set(context, names); } catch (Exception ex) { MessageBox.Show(ex.Message); } }