Created a simple WCF Service
Interface:
using System.ServiceModel;
namespace AsyncCollectorAndWorker
{
[ServiceContract]
public interface IUsageLogger
{
[OperationContract]
void LogSearch(string term);
[OperationContract]
void LogSearchSuggestion(System.Guid id);
}
}
Service:
using System;
namespace AsyncCollectorAndWorker
{
public class UsageLogger : IUsageLogger
{
public void LogSearch(string term)
{
Console.WriteLine("{0} Search Term: '{1}'", DateTime.Now, term);
}
public void LogSearchSuggestion(Guid id)
{
Console.WriteLine("{0} Search Suggestion: '{1}'", DateTime.Now, id);
}
}
}
Console app to host it:
host = new ServiceHost(typeof(MainService), new Uri(AutoMappedConfig.WcfHostAddress));
ServiceMetadataBehavior smb = new ServiceMetadataBehavior() { HttpGetEnabled = true };
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
host.Description.Behaviors.Add(smb);
host.Open();
Console.WriteLine($"Listeing on {AutoMappedConfig.WcfHostAddress}");
And this works, as you can tell below:
But opening the ?wsdl url does nothing. I have done this before, exact same setup, and it just works. I have no clue why this doesn't. Any help is appreciated. I've checked with Fiddler to see the raw response, but it just returns the same response with and without the WSDL.