WCF REST:WebHost无法处理请求

问题描述:

我有一个WCF服务部署在负载均衡器后面,当我尝试使用SOAP访问它时它工作得很好,但是当我尝试通过REST URL访问它时,出现下面提到的错误。WCF REST:WebHost无法处理请求

这是REST URL我试图以https去实现它:// devreporting.dev.sample.com/ReportingManagement.svc/getAddtionsByCategory ..

负载平衡器VIP为https:// devreporting.dev .sample.com和防火墙后面只有一个服务器是dev01

我相信这是主机头的一些问题,但不知道如何解决这个问题。任何想法将不胜感激。

Message: WebHost failed to process a request. Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/12646224 
Exception: 

System.Web.HttpException: There was no channel actively listening at 'https://dev01.dev.sample.com:17005/ReportingManagement.svc/reporting/getAddtionsByCategory'. 
     This is often caused by an incorrect address URI. 
     Ensure that the address to which the message is sent matches an address on which a service is listening. ---> 
    System.ServiceModel.EndpointNotFoundException: There was no channel actively listening at 'https://dev01.dev.sample.com:17005/ReportingManagement.svc/reporting/getAddtionsByCategory'. 
      This is often caused by an incorrect address URI. 
      Ensure that the address to which the message is sent matches an address on which a service is listening. 
    at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)  
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() 
    --- End of inner exception stack trace ---  
    at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) 
    Process Name: w3wp Process ID: 4760 
+0

能否请您解释一下是什么SOAPURI之间的差异和休息URI,你的意思是一个在Http上,另一个在Https上? – hussian 2016-04-26 13:59:10

呼......我失去了我的部分安全配置,当我说了,事情的来龙去脉般的魅力

<webHttpBinding> 
    <binding name="CommerceRESTBinding"> 
     <security mode="Transport"> 
       <transport clientCredentialType = "None" proxyCredentialType="None"/> 
     </security> 

</binding> 
    </webHttpBinding> 
+0

这是哪里?你能从web.config发布完整的代码片段吗? – 2012-04-16 11:59:59

“没有渠道积极倾听”听起来像它说的。在请求发出时,没有任何人收听17005端口。

确保这是正确的URL。从命令提示符窗口中的服务器上发出以下命令来测试一下:

telnet localhost 17005输入
GET /输入;注意:这不会呼应
输入

如果这工作(连接并从IIS中取回某些东西),然后从负载平衡器远端的客户机运行相同的测试。当然,在这种情况下,请使用完整的主机名称而不是localhost

<system.serviceModel> 
    <bindings> 
     <webHttpBinding> 
     <binding name="TransportSecurity"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None"/> 
      </security> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    <services> 
     <service name="Service" behaviorConfiguration="ServiceBehaviour"> 
     <endpoint address="" binding="webHttpBinding" behaviorConfiguration="webMyAcc" bindingConfiguration="TransportSecurity" contract="IService"/> 
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="ServiceBehaviour"> 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
     <endpointBehaviors> 
     <behavior name="webMyAcc"> 
      <webHttp /> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    <client />`enter code here` 
    </system.serviceModel>