none
WCF.. Host error RRS feed

  • Question

  • I am using this:

    ("http://localhost:8090/whereever");

      private void btnStart_Click(object sender, EventArgs e)
            {
                //Get the type object...
                Type t = typeof(NumericService.MyNumericService);
               
                //Create a URI to Server as base address...
                Uri httpUrl = new Uri("http://localhost:8090/whereever");

                //Create ServiceHost
                host = new ServiceHost(t, httpUrl);
                
                //add a service endpoints...
                host.AddServiceEndpoint(typeof(NumericService.IMyNumericServe), new WSHttpBinding(),"xxx");
                host.AddServiceEndpoint(typeof(NumericService.IMyNumericServe), new BasicHttpBinding(),"yyy");
                host.AddServiceEndpoint(typeof(NumericService.IMyNumericServe), new WSDualHttpBinding(), "zzz");

                //Enable Metedata exchange
                ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
                smb.HttpGetEnabled = true;
                host.Description.Behaviors.Add(smb);
                
                //start the Service
                host.Open();
                Console.WriteLine("Service is host at");
                label1.Text = "Service is host at" + DateTime.Now.ToString();
               

            }

    Saturday, January 4, 2014 3:21 AM

Answers