2012-12-26 9 views
5

Nel mio codice faccio richieste WCF a un endpoint https://. A volte il server WCF sarà irraggiungibile per qualsiasi motivo e quindi il mio codice produrrà e un'eccezione:Perché ottengo un'eccezione con "traccia dello stack del server" quando il client non riesce nemmeno a connettersi al server WCF?

System.TimeoutException 
The request channel timed out while waiting for a reply after 00:01:00. 
Increase the timeout value passed to the call to Request or increase 
the SendTimeout value on the Binding. The time allotted to this operation 
may have been a portion of a longer timeout. 

e la .StackTrace dell'eccezione contiene il seguente testo:

Server stack trace: <<<< THE QUESTION IS ABOUT THIS VERY LINE 
    at System.ServiceModel.Channels.RequestChannel.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 [my code here invoking an OperatiionContract-attributed method 

e il .InnerException è un altro TimeoutException con il seguente messaggio:

The HTTP request to 'https://management.core.windows.net/subscription-id-here/ 
    services/hostedservices/service-name-here/deployments/deployment-id-here' 
has exceeded the allotted timeout of 00:01:00. The time allotted to this 
operation may have been a portion of a longer timeout. 

Quello che non capisco è il Server stack trace fraseggio.

Perché è "server" se la mia richiesta non ha nemmeno ricevuto risposta dal server?

+1

Sei sicuro che le richieste dei client non abbiano raggiunto il servizio WCF? Forse c'è qualche eccezione sul servizio – sll

+0

Prova ad aumentare i timeout che sono per '1: 00' e vedere se funziona meglio. –

+0

@John Saunders: Come riceverò un'eccezione senza menzionare "traccia del server"? – sharptooth

risposta

0

Un timeout può verificarsi su entrambi i lati della connessione; client o server. Pertanto, in base all'eccezione, direi che il client è connesso al server ma poiché non è stata generata una risposta in tempo (in base ai binding del server per sendTimeout), WCF ha risposto come hai visto.

Vedere http://msdn.microsoft.com/en-us/library/hh924831(v=vs.110).aspx per ulteriori informazioni sulle impostazioni di timeout.

Problemi correlati