WCF service returning 404 on method requests

后端 未结 8 1710
-上瘾入骨i
-上瘾入骨i 2020-12-09 03:06

I have a WCF service page running only WebGets/WebInvokes over SSL - it works fine on my local machine (self signed cert). On production, however, I can reach service.svc (a

相关标签:
8条回答
  • 2020-12-09 03:42

    I had the same problem. From what I read, WCF isnt NT Authenticated authorization (or HTTPContext compatible) by default.

    I had to add this to my config file for the WCF service web.config in the section:

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    

    Which you did, plus this:

    And on the actual service class definiation I had to add:

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class DataService : IDataDeliveryServiceContract
    

    This fixed my problem.

    0 讨论(0)
  • 2020-12-09 03:47

    The following setting in web.config fixed a WCF .svc 404 on a HTTPS web site :

          <webHttpBinding>
                 <!-- https -->
                 <security mode="Transport">
                        <transport clientCredentialType = "None" proxyCredentialType="None"/>
                </security>
        </binding>
      </webHttpBinding>
    
    0 讨论(0)
提交回复
热议问题