2009-07-28 66 views
5

我有一個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

回答

11

呼......我失去了我的部分安全配置,當我說了,事情的來龍去脈般的魅力

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

</binding> 
    </webHttpBinding> 
+0

這是哪裏?你能從web.config發佈完整的代碼片段嗎? – 2012-04-16 11:59:59

0

「沒有渠道積極傾聽」聽起來像它說的。在請求發出時,沒有任何人收聽17005端口。

確保這是正確的URL。從命令提示符窗口中的服務器上發出以下命令來測試一下:

telnet localhost 17005輸入
GET /輸入;注意:這不會呼應
輸入

如果這工作(連接並從IIS中取回某些東西),然後從負載平衡器遠端的客戶機運行相同的測試。當然,在這種情況下,請使用完整的主機名稱而不是localhost

0
<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>