using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Web.Script.Serialization; class DddWrapper { public static void Main(string [] args) { List Eans = new List(); Dictionary Output = new Dictionary(); StockService Service1 = new StockService(); var result = Service1.GetWebshopArticles(927001, "59cmsI923mSK12sXm39mSa9157caq15vxalSfks2"); StreamWriter outfile = new StreamWriter("dddproducts.json", false); outfile.Write ( result ); outfile.Close(); var WebshopArticles = new JavaScriptSerializer().Deserialize>>(result); foreach ( Dictionary val in WebshopArticles ) Eans.Add( Convert.ToInt64(val["Ean"]) ); var response = Service1.StockCountByParameter( Eans.ToArray(), 927001, "59cmsI923mSK12sXm39mSa9157caq15vxalSfks2"); foreach (ArrayOfKeyValueOflongintKeyValueOflongint val in response) { Output[ val.Key.ToString() ] = val.Value; } Console.Write(new JavaScriptSerializer().Serialize(Output)); } }