我有以下周转基金:
[OperationContract]
IList<OperationRoomDto> GetOperationRooms();而且我有一个使用这个WCF的网站,当我使用Visual (Asp.Net开发服务器)时,它工作得很好,但是当我将WCF部署到IIS时,我得到了这个异常:
远程服务器返回一个错误:(405)方法不允许。
我制作了一个简单的网站来测试这个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服务类之前。
发布于 2012-09-30 07:40:04
我发现了这个问题,因为wcf的Url不正确,它错过了服务文件名
<endpoint address="http://server/WcfService"它应成为:
<endpoint address="http://server/WcfService/Service.svc"https://stackoverflow.com/questions/12658809
复制相似问题