请求的服务无法激活WCF

时间:2014-11-10 06:44:04

标签: c# wcf wcf-rest

我有一个带有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>

这可能是什么原因

1 个答案:

答案 0 :(得分:0)

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

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