static void Main(string[] args) { var appHost = new AppHost(); appHost.Init(); appHost.Start(ListeningOn); Console.WriteLine("Started listening on: " + ListeningOn); Console.WriteLine("AppHost Created at {0}, listening on {1}", DateTime.Now, ListeningOn); Process.Start(ListeningOn); Console.WriteLine("ReadKey()"); Console.ReadKey(); }
static void Main(string[] args) { LogManager.LogFactory = new ConsoleLogFactory(); var listeningOn = args.Length == 0 ? "http://*:8090/" : args[0]; var appHost = new AppHost(); appHost.Init(); appHost.Start(listeningOn); Console.WriteLine("AppHost Created at {0}, listening on {1}", DateTime.Now, listeningOn); Console.ReadKey(); }
static void Main(string[] args) { var app = new AppHost(); app.Start(); Process.Start(app.URL); //JsonServiceClient client = new JsonServiceClient(app.URL); //var response = client.Get<HttpWebResponse>("/json/reply/OrderRequestDto"); /* ServiceStack */ Console.WriteLine("Following tests are done using ServiceStack serializer"); Console.WriteLine(); Print("TEST: Buyer attached to each order:"); SendRequest(app.URL + "json/reply/OrderRequestDto?AttachBuyerToOrder=true"); Console.WriteLine(); Print("TEST: Buyer was not set to order (need assembler):"); SendRequest(app.URL + "json/reply/OrderRequestDto?AttachBuyerToOrder=false"); /* JSON.NET */ Console.WriteLine(); Console.WriteLine("Following tests are done using JSON.NET serializer"); Console.WriteLine(); JsConfig<OrderResponseDto>.RawSerializeFn = t => JsonConvert.SerializeObject(t); JsConfig<OrderResponseDto>.RawDeserializeFn = t => JsonConvert.DeserializeObject<OrderResponseDto>(t); Print("TEST: Buyer attached to each order:"); SendRequest(app.URL + "json/reply/OrderRequestDto?AttachBuyerToOrder=true"); Console.WriteLine(); Print("TEST: Buyer was not set to order (need assembler):"); SendRequest(app.URL + "json/reply/OrderRequestDto?AttachBuyerToOrder=false"); "Press any key to exit...".Print(); Console.ReadLine(); }