http://bugzilla.novell.com/show_bug.cgi?id=626950

http://bugzilla.novell.com/show_bug.cgi?id=626950#c1


--- Comment #1 from Daniele Balbini <[email protected]> 2010-07-30 
08:53:01 UTC ---
A little sample of the service hosted
#region hosting the service 

      Uri baseAddress = new Uri("http://127.0.0.1:18080/MyDaemon";); 
      string address = "http://127.0.0.1:18080/MyDaemon";; 

      using (ServiceHost host = new ServiceHost(typeof(CommunicatorServices),
baseAddress)) 
      { 
        BasicHttpBinding binding = new
BasicHttpBinding(BasicHttpSecurityMode.None); 
        host.AddServiceEndpoint(typeof(ICommunicatorServices), binding,
address); 

        ServiceMetadataBehavior serviceMetadataBehavior =
host.Description.Behaviors.Find<ServiceMetadataBehavior>(); 

        if (serviceMetadataBehavior == null) 
        { 
          serviceMetadataBehavior = new ServiceMetadataBehavior(); 
          host.Description.Behaviors.Add(serviceMetadataBehavior); 
        } 
        host.AddServiceEndpoint(typeof(IMetadataExchange),
MetadataExchangeBindings.CreateMexHttpBinding(),
"http://127.0.0.1:18080/MyDaemon/mex";); 

        host.Open(); 
        Console.WriteLine("Service is running....press any key to terminate."); 
        Console.ReadKey(); 
        host.Close(); 
#endregion

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to