WCF endpoint not found

前端 未结 2 1450
时光取名叫无心
时光取名叫无心 2021-01-13 08:47

I\'m following a tutorial in a book to implement push notifications for Windows Phone. This is the markup of the service:

<%@ ServiceHost Language=\"C#\"          


        
相关标签:
2条回答
  • 2021-01-13 09:06

    For those who absently implement the method in Service.svc that its definition is absent in IService causes the same exception.

    This is forgotten

    [OperationContract]
     string CheckHMAC(string hMac);
    

    But implemented

    [WebInvoke(Method = "GET", UriTemplate = "/CheckHMAC/{hMac}")]
    public string CheckHMAC(string hMac)
    {//}
    
    0 讨论(0)
  • 2021-01-13 09:11

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

    Add this to your web.config:

    <system.serviceModel>
      <services>
        <service name="Service.PushService">
          <endpoint address="" binding="basicHttpsBinding"
                    contract="Service.IPushService" />
        </service>
      </services>
    </system.serviceModel>
    
    0 讨论(0)
提交回复
热议问题