gpt4 book ai didi

WCF 请求失败,HTTP 状态为 405 : Method Not Allowed

转载 作者:行者123 更新时间:2023-12-04 12:26:08 25 4
gpt4 key购买 nike

我有一个 WCF 服务,它已托管在 Windows 服务上,并使用 BasicHttp 端点为已连接到它的 Windows Mobile 设备提供服务。

问题在于设备模拟器。我可以毫无问题地连接到该服务并使用它,但使用的是实际设备。我收到错误:

WCF The request failed with HTTP status 405: Method Not Allowed.



我使用以下代码来实现该服务。
BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
basicHttpBinding.UseDefaultWebProxy = false;

m_ServiceHost.AddServiceEndpoint(typeof(IKooft), basicHttpBinding, "KooftService");
m_ServiceHost.Open();

我怎么解决这个问题?

最佳答案

检查您的 IIS 扩展名,尤其是 .wsdl 的扩展名是否有效:

在 IIS 中:

  • 查看您网站的属性。
  • 在主目录选项卡中,单击
    配置。
  • 点击添加(我的路径是
    "C:\Program Files (x86)\Common
    文件\MSSOAP\BINARIES\SOAPIS30.DLL")
  • 将扩展名设置为 .WSDL 并允许
    “获取”和“发布”
  • 选择“脚本
    引擎”和“验证文件存在”

  • 应该是这样。

    关于WCF 请求失败,HTTP 状态为 405 : Method Not Allowed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/368494/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com