首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >方法在使用IIS时不允许405。

方法在使用IIS时不允许405。
EN

Stack Overflow用户
提问于 2012-09-30 05:08:09
回答 1查看 7.5K关注 0票数 6

我有以下周转基金:

代码语言:javascript
复制
    [OperationContract]
    IList<OperationRoomDto> GetOperationRooms();

而且我有一个使用这个WCF的网站,当我使用Visual (Asp.Net开发服务器)时,它工作得很好,但是当我将WCF部署到IIS时,我得到了这个异常:

远程服务器返回一个错误:(405)方法不允许。

我制作了一个简单的网站来测试这个WCF (在IIS上),它起了作用。

这是网站web.config文件的一部分:

代码语言:javascript
复制
  <endpoint address="http://server/WcfService"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMessageService"
            contract="MyProject.Web.Wcf.IMessageService" name="BasicHttpBinding_IMessageService">
  </endpoint>

web服务配置文件的这一部分:

代码语言:javascript
复制
  <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服务类之前。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-30 07:40:04

我发现了这个问题,因为wcf的Url不正确,它错过了服务文件名

代码语言:javascript
复制
<endpoint address="http://server/WcfService"

它应成为:

代码语言:javascript
复制
<endpoint address="http://server/WcfService/Service.svc"
票数 12
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12658809

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档