Ejemplo n.º 1
0
        public void WebDataServiceWcfEntryPoint()
        {
            Type            serviceType = typeof(OpenWebDataService <>).MakeGenericType(typeof(CustomDataContext));
            DataServiceHost host1       = UnitTestsUtil.StartHostProcess(serviceType, "http://localhost:{port}/TheTest", (host) => {
                ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(IRequestHandler), new WebHttpBinding(), "");
            });

            try
            {
                System.Net.WebRequest  request  = System.Net.WebRequest.Create(host1.BaseAddresses[0].ToString());
                System.Net.WebResponse response = request.GetResponse();
                Trace.WriteLine(new StreamReader(response.GetResponseStream()).ReadToEnd());
            }
            finally
            {
                host1.Close();
            }
        }