2013-07-10 36 views
27

Sto sviluppando un servizio WCF, con IIS6 in esecuzione su Windows Server 2003. Ho creato un client di prova per parlare con il servizio WCF e sto ricevendo l'errore di seguito. Ho osservato questo errore per giorni e ho esaminato i suggerimenti delle persone sui forum, ma senza fortuna. Qualsiasi aiuto sarebbe apprezzato, molte grazieErrore WCF - Nessun endpoint in ascolto su

Non c'era nessun endpoint in ascolto su https://webbooking.infodata.uk.com/Synxis/Synxis.svc che poteva accettare il messaggio. Questo è spesso causato da un indirizzo errato o un'azione SOAP. Vedi InnerException, se presente, per maggiori dettagli.

System.Net.WebException: The remote server returned an error: (404) Not Found. 
    at System.Net.HttpWebRequest.GetResponse() 
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 

Server stack trace: 
    at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) 
    at System.ServiceModel.Channels.HttpChannelFactory.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) 

Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    at IOta2010A.ReservationSynch_SubmitRequest(ReservationSynchRequest request) 
    at Ota2010AClient.IOta2010A.ReservationSynch_SubmitRequest(ReservationSynchRequest request) in c:\Development\WorkingFolder\Webservices\SynxisNew\App_Code\OTA2010A.cs:line 57589 
    at Ota2010AClient.ReservationSynch_SubmitRequest(Security Security, DateTime& TimeStamp, String CorrelationID, String RelatesToCorrelationID, ReplyTo ReplyTo, OTA_HotelResNotifRQ OTA_HotelResNotifRQ) in c:\Development\WorkingFolder\Webservices\SynxisNew\App_Code\OTA2010A.cs:line 57601 
    at Update.Page_Load(Object sender, EventArgs e) in c:\Development\WorkingFolder\Webservices\SynxisNew\Update.aspx.cs:line 72 

configurazione client

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.web> 
    <compilation debug="true"/> 
    </system.web> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
      <binding name="ota2010AEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" 
       receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" 
       transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
       maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
       messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
       allowCookies="false"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       <reliableSession ordered="true" inactivityTimeout="00:10:00" 
        enabled="false" /> 
       <security mode="Transport"> 
        <transport clientCredentialType="None" proxyCredentialType="None" 
         realm="" /> 
        <message clientCredentialType="Windows" negotiateServiceCredential="true" 
         establishSecurityContext="true" /> 
       </security> 
      </binding> 
     </wsHttpBinding> 
     </bindings> 
     <client> 
      <endpoint address="https://webbooking.infodata.uk.com/synxis/synxis.svc" 
       binding="wsHttpBinding" bindingConfiguration="ota2010AEndpoint" 
       contract="IOta2010A" name="ota2010AEndpoint" /> 
     </client> 
    </system.serviceModel> 
</configuration> 

config Servizio

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
     <add assembly="Pervasive.Data.SqlClient, Version=2.10.0.34, Culture=neutral, PublicKeyToken=C84CD5C63851E072"/> 
     </assemblies> 
    </compilation> 
    <authentication mode="Windows"/> 
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/> 
    </system.web> 
    <system.serviceModel> 
    <services> 
     <service name="Synxis" behaviorConfiguration="SynxisWCF"> 
     <endpoint address="" name="wsHttpEndpoint" binding="wsHttpBinding" contract="Synxis" /> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <diagnostics> 
     <messageLogging logEntireMessage="true" logMalformedMessages="true" 
     logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" 
     maxMessagesToLog="300" /> 
    </diagnostics> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="SynxisWCF" > 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" externalMetadataLocation="https://webbooking.infodata.uk.com/synxis/Synxis.svc.wsdl" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 
+0

Cosa vedi quando apri l'URL del servizio direttamente dal browser? – Mayo

+0

Quando apro il collegamento dell'URL del servizio, vedo la pagina "Hai creato un servizio", come previsto. –

+0

Nella configurazione del servizio si dispone di elementi endpoint il cui valore attributo contratto è solo il nome classe/interfaccia, mentre dovrebbe essere un nome completo i.e namespace.Synxis – Rajesh

risposta

12

non si definisce un binding in config del servizio, in modo che si stanno ottenendo i valori predefiniti per wsHttpBinding e il valore predefinito per securityMode\transport per tale associazione è Message.

provare a copiare la configurazione di associazione dal config del cliente al servizio di configurazione e assegnare tale legame con l'endpoint tramite l'attributo bindingConfiguration:

<bindings> 
    <wsHttpBinding> 
    <binding name="ota2010AEndpoint" 
      .......> 
     <readerQuotas maxDepth="32" ... /> 
     <reliableSession ordered="true" .... /> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" proxyCredentialType="None" 
         realm="" /> 
      <message clientCredentialType="Windows" negotiateServiceCredential="true" 
        establishSecurityContext="true" /> 
      </security> 
    </binding> 
    </wsHttpBinding> 
</bindings>  

(parti tagliò della configurazione per risparmiare spazio nella risposta).

<service name="Synxis" behaviorConfiguration="SynxisWCF"> 
    <endpoint address="" name="wsHttpEndpoint" 
       binding="wsHttpBinding" 
       bindingConfiguration="ota2010AEndpoint" 
       contract="Synxis" /> 

Questo assegnerà quindi l'associazione definita (con sicurezza di trasporto) all'endpoint.

+0

Questa è la soluzione al mio problema! Grazie! –

+0

Metto alla prova la tua soluzione per il mio problema ma non ottengo risposta !! http://stackoverflow.com/questions/38856971/wcf-http-binding – Farshid

2

Ho avuto lo stesso problema. Per me ho notato che https sta usando un altro certificato che non era valido in termini di data di scadenza. Non so perché sia ​​successo. Ho cambiato il numero di porta Https e un nuovo certificato autofirmato. WCFtestClinet potrebbe connettersi al server tramite HTTPS!

0

Stavo ricevendo lo stesso errore con un accesso di servizio. Funzionava nel browser, ma non funzionava quando provavo ad accedervi nella mia applicazione asp.net/c#. Ho cambiato il pool di applicazioni da appPoolIdentity a NetworkService e ha iniziato a funzionare. Sembra un problema di autorizzazione per me.

1

nel mio caso

il mio servizio ha funzione di Upload Files

e questo errore appena mostrato fino a cercare di caricare Big Files

così ho trovato this answer per aumentare maxRequestLength al valore necessario in web.config

e risolto il problema

se non si apportano le operazioni di caricare o scaricare forse questa risposta non ti aiuterà

+0

prima del voto down ,, hai effettuato operazioni di upload o download? –

0

caso diverso, ma può aiutare qualcuno,

Nel mio caso firewall finestra era abilitato sul server,

Two pensa può essere fatto,

1) Disabilita firewall di Windows (la vostra sul rischio ma otterrà il lavoro cosa)

2) Aggiungere la porta in regola in entrata.

Grazie.

Problemi correlati