Bugzilla – Bug 626950
HttpWebRequest_WebException_RemoteServer using ServiceHost
Last modified: 2010-08-04 02:41:33 UTC
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.125 Safari/533.4 I have hosted a ServiceHost (WCF service), i see that it be implemented on mono. My app have 2 side. A daemon / service and a SilverLight client, daemon and client run always on the same machine. With .NetFramework all run as well, the service and the sl client communicate correctly. The same code, on a mac and compiled on mono run but when the sl client try to connect, and use one exposed method, it return me "HttpWebRequest_WebException_RemoteServer" Arguments: NotFound. The code is correct, on win it run but i do not understand why not in mono - mac Reproducible: Always Steps to Reproduce: 1.Expose a ServiceHost on a localhost endpoint. 2.Run a Silverlight Out Of Browser application. 3.Try to use one of the webmethod hosted in the WCF service Actual Results: "HttpWebRequest_WebException_RemoteServer" Arguments: NotFound. The Silverlight client have no problem. Is the same that run on Win (Microsoft make a sl framework for mac), and it run well on windows and .net
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
You're using 2.6, which still had a lot of issues that have been already fixed (including some with related to wrong web response). Try git head instead and see if it's still there.