Bug 626950

Summary: HttpWebRequest_WebException_RemoteServer using ServiceHost
Product: [Mono] Mono: Class Libraries Reporter: Daniele Balbini <daniele.bini>
Component: WCFAssignee: Atsushi Enomoto <atsushieno>
Status: CONFIRMED --- QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None Flags: aenomoto: needinfo? (daniele.bini)
Version: 2.6.x   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X 10.6   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Daniele Balbini 2010-07-30 08:43:08 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
Comment 1 Daniele Balbini 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
Comment 2 Atsushi Enomoto 2010-08-04 02:41:33 UTC
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.