相关疑难解决方法(0)

WCF服务通过https而不是http返回404

我正在将现有服务从HTTP(Dev/UAT)迁移到HTTPS(生产),我遇到配置问题.这是我的web.config的system.serviceModel部分:

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
    <services>
      <service name="MyService">
        <endpoint name="MyEndpoint" address="" binding="wsHttpBinding"
            bindingConfiguration="secureBinding" contract="IMyService" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="secureBinding">
          <security mode="Transport"></security>
        </binding>
      </wsHttpBinding>
    </bindings>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

我已经试过这同时使用basicHttpBindingwsHttpBinding,与相同的结果:

  • 我可以使用我的SOAP客户端调用该服务 http://server.domain.com/MyService.svc
  • 我可以使用浏览器来点击该服务 https://server.domain.com/MyService.svc
  • 我不能使用https://server.domain.com/MyService.svc- 我的SOAP客户端调用服务- 调用总是错误404: not found.

我的https站点使用由公司域上的CA颁发的证书进行了认证,并且我已经验证我已在Trusted Root Certification Authorities我正在进行呼叫的系统上安装了CA的证书.

相关客户代码:

Service service = new Service();
service.Url = "http://server.domain.com/MyService.svc";
//service.Url = "https://server.domain.com/MyService.svc";
service.WebMethodCall();
Run Code Online (Sandbox Code Playgroud)

编辑

以下是WSDL的请求部分:

<wsdl:types/> …
Run Code Online (Sandbox Code Playgroud)

https wcf soap

10
推荐指数
1
解决办法
3万
查看次数

标签 统计

https ×1

soap ×1

wcf ×1