WCF endpoint not found

I follow the tutorial in the book to implement push notifications for Windows Phone. This is the markup of the service:

<%@ ServiceHost Language="C#" Debug="true" Service="Service.PushService" CodeBehind="PushService.svc.cs" Factory="System.ServiceModel.Activation.WebServiceHostFactory" %> 

As you can see, a factory has been added, although I really don’t understand what it is for. When the service starts, I get an "endpoint not found" error. When I remove the factory from the markup, the error disappears, but I get a blank page.

Any idea what might cause this error or how to fix it? If you need more code, let me know.

thanks

EDIT: My web.config:

 <?xml version="1.0"?> <configuration> <appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5"/> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the values below to false before deployment --> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <protocolMapping> <add binding="basicHttpsBinding" scheme="https" /> </protocolMapping> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> <!-- To browse web app root directory during debugging, set the value below to true. Set to false before deployment to avoid disclosing web app folder information. --> <directoryBrowse enabled="true"/> </system.webServer> </configuration> 
+4
source share
2 answers

You are missing the endpoint configuration in the web.config file.

Add this to your web.config:

 <system.serviceModel> <services> <service name="Service.PushService"> <endpoint address="" binding="basicHttpsBinding" contract="Service.IPushService" /> </service> </services> </system.serviceModel> 
+8
source

For those who absent-mindedly implement a method in Service.svc that its definition is absent in IService, the same exception occurs.

It's forgotten

 [OperationContract] string CheckHMAC(string hMac); 

But implemented

 [WebInvoke(Method = "GET", UriTemplate = "/CheckHMAC/{hMac}")] public string CheckHMAC(string hMac) {//} 
0
source

All Articles