Question

J'écris un service Web SharePoint très basique. J'ai testé contre la petite bibliothèque 2010 et cela fonctionne bien à chaque fois.

problème est livré avec le serveur MOSS 2007 où une bibliothèque est très grande. J'utilise .NET 3.5 et avec juste en dessous de trois lignes de code, je reçois une erreur au hasard, le canal de demande a expiré en attendant une réponse après 00:00:59. Si j'augmente le temps d'attente, alors toujours au hasard, je reçois une erreur, La connexion sous-jacente a été fermée: la connexion a été fermée de manière inattendue.

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();

Je n'ai aucune idée de la raison pour laquelle il est coupé au hasard, le serveur n'a aucun problème. J'ai un constructeur U2u Caml et l'utiliser, je ne peux pas exécuter de requête et obtenir des résultats de retour instantanément.

Je pense qu'il y a quelque chose qui ne va pas chez mon app.config ou quelque chose que j'ai besoin de définir le côté du client.

mon app.config a ci-dessous le réglage,

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

et

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

Je reçois ci-dessous une erreur lorsque je chnage de tous les temps à 10 minutes. Et encore une fois, c'est aléatoire .

   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

Était-ce utile?

La solution 2

i problème corrigé mais je ne suis pas sûr que cela s'est passé peut-être que certains experts puissent commenter.

solution était, au lieu d'ajouter en tant que référence de service, j'ai ajouté en tant que référence Web et cela a fait du tour.

Mes hypothèses pour des raisons sont ci-dessous,

  1. soit MOSS 2007 n'aime pas le client proxy créé par référence de service
  2. Dans mon réseau, nous avons deux applications avec le même nom dans différents domaines, bien que j'utilisais le nom pleinement qualifié dans la référence de service, de sorte que cela ne devrait pas être causée

    merci

Autres conseils

Modifier les éléments suivants:

closeTimeout="00:01:00" openTimeout="00:01:00"
        receiveTimeout="00:10:00" sendTimeout="00:01:00"

à:

closeTimeout="00:10:00" openTimeout="00:10:00"
        receiveTimeout="00:10:00" sendTimeout="00:10:00"

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top