WCF方法不允许

问题描述:

我完全不熟悉WCF,并且创建了这些函数。 在我的本地主机完美工作,但将它放在IIS后,当我尝试使用它时,出现errormessage 405“方法不允许”。WCF方法不允许

[ServiceContract] 
    public interface IService1 
    { 
     [WebInvoke(Method = "GET")] 
     [OperationContract] 
     string EncryptZonderPaswoord(string tekst); 

     [WebInvoke(Method = "GET")] 
     [OperationContract] 
     string EncryptMetPaswoord(string tekst, string paswoord); 

     [WebInvoke(Method = "GET")] 
     [OperationContract] 
     string DecryptZonderPaswoord(string tekst); 

     [WebInvoke(Method = "GET")] 
     [OperationContract] 
     string DecryptMetPaswoord(string tekst, string paswoord); 
    } 

...

任何人的想法?我需要在IIS上设置哪些额外属性?

我已经解决了我的问题。 这是我必须做的:

  • 在IIS安装WCF .NET Framework中的服务器端
  • 寄存器架构4.0服务器端
  • :我的应用程序添加到.NET 4池,而不是默认池。