无法激活请求的服务WCF

本文关键字:服务 WCF 请求 激活 | 更新日期: 2023-09-27 18:30:00

我有一个带有webHttpBinding的wcf服务(REST),我首先将其配置为HTTP并托管在本地IIS中,它在那里运行得很好,现在我将其移动到带有Https的测试服务器,将安全模式更改为传输,但现在我收到一个异常,说服务无法激活。IIS未记录任何

Server stack trace: 
   at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

配置类似于此

 <webHttpBinding>
    <binding name="WebHttpBinding_StatusReportService"
      closeTimeout="10:10:00" openTimeout="10:10:00" sendTimeout="10:10:00"
      maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="Transport">
        <transport clientCredentialType="None" />
      </security>
    </binding>
  </webHttpBinding>
  <endpoint address="https://...../Services/StatusReportingService.svc"
   behaviorConfiguration="webEndpoint" binding="webHttpBinding"
   bindingConfiguration="WebHttpBinding_StatusReportService"
   contract="ServiceReference1.StatusReportService"
   name="WebHttpBinding_StatusReportService" />
   <behavior name="webEndpoint">
              <webHttp />
            </behavior>

这个的原因是什么

无法激活请求的服务WCF

请尝试添加证书并更改IIS中的SSL设置。

链接http://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx捕获所有步骤。