【问题标题】:Wcf webservice not working after migration to https迁移到 https 后,Wcf Web 服务无法正常工作
【发布时间】:2022-01-13 18:29:44
【问题描述】:

当我们通过 http 使用 wcf 服务时,我的 react 应用程序运行良好。我们决定为我们的网站实施 SSL,但现在该服务无法正常工作。尝试了许多网络配置设置,但它不起作用。阅读微软网站上的许多文档,但无法解决此问题。

网络配置

    <bindings>
    <webHttpBinding>
      <binding name="largeMessage" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00">
        <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
        <security mode="Transport"/>
      </binding>
    </webHttpBinding>
  </bindings>
  <services>
    <service name="Service.EService" behaviorConfiguration="serviceBehaviors">
      <endpoint address="" contract="Service.IEService" binding="webHttpBinding" bindingConfiguration="largeMessage" behaviorConfiguration="web"></endpoint>
      <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" bindingConfiguration="httpsBinding" />
    </service>
  </services>

【问题讨论】:

  • “不工作”是什么意思?你得到什么错误?乍一看,我会将&lt;security mode="None"/&gt; 更改为&lt;security mode="Transport"/&gt;
  • 将其更改为传输仍然给出错误“服务器上发生应用程序错误”
  • 通过添加 app.config 来尝试 WCF 跟踪以获取更多详细信息。见Configuring Tracing
  • 你是否设置httpsGetEnabled="true" 允许https请求。 &lt;behaviors&gt;&lt;serviceBehaviors&gt;&lt;behavior&gt;&lt;serviceMetadata httpsGetEnabled="true"/&gt;&lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;&lt;/behavior&gt;&lt;/serviceBehaviors&gt;&lt;/behaviors&gt;geeksarray.com/blog/…

标签: c# web-services wcf web-config


【解决方案1】:
  1. 把 httpsGetEnabled="true"

  2. 使安全模式=“传输”

3 删除行端点 contract="IMetadataExchange" binding="mexHttpBinding" address="mex" bindingConfiguration="httpsBinding" />

进行这些更改后,我现在可以让服务在 https 上运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多