我有以下的WCF:
[OperationContract]
IList<OperationRoomDto> GetOperationRooms();
我有一个使用WCF的网站,当我在Visual Studio中使用(Asp.Net开发服务器)时,一切正常,但当我将WCF部署到IIS时,出现以下异常:
The remote server returned an error: (405) Method Not Allowed.
我创建了一个简单的网站来测试这个WCF(在IIS上),它能够工作。
以下是网站web.config文件的一部分:
<endpoint address="http://server/WcfService"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMessageService"
contract="MyProject.Web.Wcf.IMessageService" name="BasicHttpBinding_IMessageService">
</endpoint>
还有web服务配置文件的这一部分:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
我试图调试w3wp.exe服务,以获取任何隐藏的异常信息,我在web服务方法上设置了断点,但调试器甚至没有到达那里,异常发生在到达web服务类之前。