Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WCF REST:WebHost无法处理请求_Wcf_Rest - Fatal编程技术网

WCF REST:WebHost无法处理请求

WCF REST:WebHost无法处理请求,wcf,rest,Wcf,Rest,我在负载平衡器后面部署了一个WCF服务,当我尝试使用SOAP访问它时,它工作得很好,但是当我尝试通过RESTURL访问它时,我得到了下面提到的错误 这是我尝试通过https://devreporting.dev.sample.com/ReportingManagement.svc/GetAdditionsByCategory访问的REST URL 负载平衡器VIP是https://devreporting.dev.sample.com,防火墙后面只有一台服务器,即dev01 我相信这是主机头的一

我在负载平衡器后面部署了一个WCF服务,当我尝试使用SOAP访问它时,它工作得很好,但是当我尝试通过RESTURL访问它时,我得到了下面提到的错误

这是我尝试通过https://devreporting.dev.sample.com/ReportingManagement.svc/GetAdditionsByCategory访问的REST URL

负载平衡器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
“没有积极倾听的渠道”听起来像它说的那样。在发出请求时,没有监听端口17005

确保这是正确的URL。通过从服务器计算机上的命令提示符窗口发出以下命令进行测试:

telnet localhost 17005
Enter
GET/
Enter;注意:这不会产生回声
输入


如果这样做有效(连接IIS并从IIS带回一些东西),那么在负载平衡器远端的客户端计算机上运行相同的测试。当然,在这种情况下,请使用完整的主机名,而不是
localhost

Phew…我在我的部分中缺少安全配置,当我添加它时,一切正常

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

</binding>
  </webHttpBinding>


`在这里输入代码`

这是怎么回事?你能从web.config发布完整的代码片段吗?非常感谢-你挽救了这一天!你能解释一下SOAPURI和RESTURI的区别吗?你是说一个在Http上,另一个在Https上?
<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>