Il canale di richiesta è scaduto durante l'attesa di una risposta dopo le 00:00:59
-
10-12-2019 - |
Domanda
Sto scrivendo un server SharePoint molto semplice. Ho testato contro la piccola biblioteca del 2010 e funziona bene ogni volta.
Problema viene fornito con il server Moss 2007 in cui una libreria è molto grande. Sto usando .NET 3.5 e con appena sotto tre righe di codice, ottengo casualmente errore, il canale di richiesta è scaduto durante l'attesa di una risposta dopo le 00:00:59. Se aumento di timeout, allora ancora casualmente ottengo errore, La connessione sottostante è stata chiusa: la connessione è stata chiusa in modo imprevisto.
ListsSoapClient client = new ListsSoapClient();
client.ClientCredentials.Windows.ClientCredential
= System.Net.CredentialCache.DefaultNetworkCredentials;
client.ClientCredentials.Windows.AllowedImpersonationLevel
= System.Security.Principal.TokenImpersonationLevel.Impersonation;
XmlElement listCollection = client.GetListCollection();
.
Non ho indizio Perché casualmente IT e rompe, il server non ha problemi. Ho U2U CAML BUILDER e UTILIZZANDO IT I POSSO ASTROP ESEGUIRE LA QUERY E Ottieni risultati immediatamente.
Penso che ci sia qualcosa di sbagliato sulla mia app.config o qualcosa di cui ho bisogno per impostare il lato client.
La mia app.config ha sotto l'impostazione,
<binding name="ListsSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm"/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
.
e
<client>
<endpoint address="http://ap/AP/_vti_bin/Lists.asmx" binding="basicHttpBinding"
bindingConfiguration="ListsSoap" contract="SharePointListWebService.ListsSoap"
name="ListsSoap" />
<endpoint address="http://ap/AP/_vti_bin/Copy.asmx" binding="basicHttpBinding"
bindingConfiguration="CopySoap" contract="SharePointCopyWebService.CopySoap"
name="CopySoap" />
</client>
.
Io ricevo sotto Errore quando credo tutto il tempo a 10 minuti. E ancora, il suo
. Unhandled Exception: System.ServiceModel.CommunicationException: The underlying
connection was closed: A connection that was expected to be kept alive was close
d by the server. ---> System.Net.WebException: The underlying connection was clo
sed: A connection that was expected to be kept alive was closed by the server.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebExc
eption(WebException webException, HttpWebRequest request, HttpAbortReason abortR
eason)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeS
pan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message messag
e, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim
eout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall
Message methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at FetchInvoicesFromSharePointForMaximo.SharePointListWebService.ListsSoap.Ge
tListCollection(GetListCollectionRequest request)
at FetchInvoicesFromSharePointForMaximo.SharePointListWebService.ListsSoapCli
ent.FetchInvoicesFromSharePointForMaximo.SharePointListWebService.ListsSoap.GetL
istCollection(GetListCollectionRequest request) in C:\FetchInvoicesFromSharePoin
tForMaximo\FetchInvoicesFromSharePointForMaximo\Service References\SharePointLis
tWebService\Reference.cs:line 2267
at FetchInvoicesFromSharePointForMaximo.SharePointListWebService.ListsSoapCli
ent.GetListCollection() in C:\FetchInvoicesFromSharePointForMaximo\FetchInvoices
FromSharePointForMaximo\Service References\SharePointListWebService\Reference.cs
:line 2273
at FetchInvoicesFromSharePointForMaximo.Program.Main(String[] args) in C:\Fet
chInvoicesFromSharePointForMaximo\FetchInvoicesFromSharePointForMaximo\Program.c
s:line 32
Soluzione 2
Ho fissato il problema ma non sono sicuro che questo è successo potrebbe essere un esperto può commentare.
La soluzione è stata, invece di aggiungere come riferimento di servizio che ho aggiunto come riferimento web e ha fatto un trucco.
Le mie ipotesi per motivi sono sotto,
- .
- entrambi Moss 2007 non piace il client proxy creato dal riferimento del servizio
- Nella mia rete abbiamo due applicazioni con lo stesso nome in diverso dominio, anche se stava usando un nome completo nel riferimento del servizio, quindi questo non dovrebbe essere causato
Grazie
Altri suggerimenti
Modifica quanto segue:
closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00"
.
A:
closeTimeout="00:10:00" openTimeout="00:10:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00"
.