|
Bugzilla – Full Text Bug Listing |
| Summary: | HttpWebRequest_WebException_RemoteServer using ServiceHost | ||
|---|---|---|---|
| Product: | [Mono] Mono: Class Libraries | Reporter: | Daniele Balbini <daniele.bini> |
| Component: | WCF | Assignee: | 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
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. |