I am trying my first WCF service, hence this could be a silly question. I have created a WCF service with service contract as
[ServiceContract]
public interface IAutoComplete
{
[OperationContract]
string[] Complete(string str);
}
And implementation of service as below:
public class AutoComplete : IAutoComplete
{
string[] IAutoComplete.Complete(string str)
{
DBContext context = new DBContext();
return context.MVCDemoes.Where(i => i.Name.StartsWith(str)).Select(i => i.Name).ToArray();
}
}
I have hosted my service in Console Application
Here is hosting configuration
<system.serviceModel>
<services>
<service name="AutoCompleteService.AutoComplete" behaviorConfiguration="AutocompleteBehavior">
<endpoint address="AutoComplete" binding="basicHttpBinding" contract="AutoCompleteService.IAutoComplete"></endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/YOUR_ADDRESS/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="AutocompleteBehavior">
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
I have started service but when I go to http://localhost:8732/Design_Time_Addresses/YOUR_ADDRESS/AutoComplete I see blank page. No error but just a blank page. What could be the issue?