WCF service returns 404 over https but not http

前端 未结 4 1953
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-04 11:49

I\'m migrating an existing service from HTTP (Dev/UAT) to HTTPS (Production), and I\'m having trouble with the configuration. Here is the system.serviceModel section of my

4条回答
  •  情歌与酒
    2021-01-04 12:08

    Thanks to Johann Blais for the answer, I've found out that you would need to include the fully qualified name for the class that defines the service contract.

    For example if your service is

    namespace MyCompany.WcfService
    {
    
        [ServiceContract(Namespace="http://xsd.mycompany.com/mcy/1_0_0")]
        public interface IService
        {
            [OperationContract(IsOneWay = false)]
            void DoStuff()
        }
    
        public class Service : IService
        {
            void DoStuff()
            {
            }
        }
    }
    

    The corresponding service definition in your web.config would be

    
        
            
                
            
        
        ...
    
    

提交回复
热议问题