2009-07-28 4 views
5

Ho un servizio WCF distribuito dietro il bilanciamento del carico, quando provo a raggiungerlo con SOAP funziona benissimo, ma quando provo a raggiungerlo tramite URL REST ottengo l'errore sotto indicato .WCF REST: WebHost non è riuscito a elaborare richiesta

Questo è l'URL REST cerco di raggiungerlo con https: // devreporting.dev.sample.com/ReportingManagement.svc/getAddtionsByCategory ..

Il bilanciamento del carico VIP è https: // devreporting.dev .sample.com e c'è solo un server dietro il firewall che è dev01

Credo che questo sia un problema con le intestazioni host, ma non sono sicuro di come risolvere questo problema. Qualsiasi idea sarebbe molto apprezzata.

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

Si può spiegare che cosa è la differenza tra la SOAPURI e il riposo URI, vuoi dire che uno è su Http e l'altro è su Https? – hussian

risposta

11

Uff ... mi mancava la configurazione di sicurezza nella mia sezione, quando ho aggiunto, le cose funzionato come fascino

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

</binding> 
    </webHttpBinding> 
+0

Dove va? Puoi pubblicare lo snippet completo da web.config? –

+0

Grazie mille - hai salvato la giornata! –

+0

Grazie mi hai salvato molte ore – coderman

0

"Nessun canale in ascolto attivo" suona come quello che dice. Non c'era nulla che ascoltasse la porta 17005 al momento della richiesta.

Assicurarsi che sia l'URL corretto. Provatelo emettendo il seguente comando da una finestra del prompt dei comandi sulla macchina server:

telnet localhost 17005Enter
GET /Enter; Nota: questo non sarà eco
Enter

Se questo funziona (collega e riporta qualcosa da IIS), quindi esegue lo stesso test da un computer client sul lato opposto del servizio di bilanciamento del carico. Naturalmente, in tal caso, utilizzare il nome host completo anziché 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>