Bonjour, j'ai un problème pour télécharger un fichier à l'aide de wcf et du streaming. Quand je passe de transferMode = "Streamed" à "Buffered" sur le client cela fonctionne, mais pas en streaming, mais aucune exception. Quand je passe le client à "Streamed" il échoue. Je me suis battue avec cela pendant des heures maintenant, et juste au maximum toutes les tailles de sorte que cela n'échoue pas. Je ne peux pas sembler trouver ce qui ne va pas. Quelqu'un peut-il le repérer?Téléchargement de fichiers volumineux dans WCF, en mode de diffusion en continu
J'ai un service avec la configuration suivante:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="GreenWebManagerServiceBinding" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Streamed" messageEncoding="Text" textEncoding="utf-8" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="GreenWebManagerServiceBehavior" name="GreenWebManagerService.ManagerService">
<host>
<baseAddresses>
<add baseAddress="http://localhost:50036/GreenWebManagerService"/>
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="GreenWebManagerServiceBinding" contract="GreenWebManagerService.IGWManagerService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="GreenWebManagerServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="500" maxConcurrentInstances="500" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
et un client avec la configuration suivante:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IGWManagerService" closeTimeout="10:01:00"
openTimeout="10:01:00" receiveTimeout="10:10:00" sendTimeout="10:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Streamed"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:50036/GWManagerService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGWManagerService"
contract="ManagerService.IGWManagerService" name="BasicHttpBinding_IGWManagerService" />
</client>
</system.serviceModel>
Je reçois l'erreur et stacktrace suivante, s'il vous plaît noter que les chiffres sont octets lire j'écris à la console:
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.ServiceModel.ProtocolException' occurred in System.ServiceModel.dll
A first chance exception of type 'System.ServiceModel.ProtocolException' occurred in System.ServiceModel.dll
256
4352
69888
135424
200960
266496
332032
397568
463104
528640
594176
659712
725248
790784
856320
921856
987392
1052928
1118464
1184000
1249536
1315072
1380608
1446144
1511680
1577216
1642752
1708288
1773824
1839360
1904896
1970432
2002629
2002629
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.ServiceModel.ProtocolException' occurred in System.ServiceModel.dll
A first chance exception of type 'System.ServiceModel.ProtocolException' occurred in mscorlib.dll
Step into: Stepping over method without symbols 'System.Reflection.TargetInvocationException.TargetInvocationException'
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Step into: Stepping over method without symbols 'System.RuntimeType.CreateInstanceImpl'
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Step into: Stepping over method without symbols 'MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance'
A first chance exception of type 'System.Xaml.XamlObjectWriterException' occurred in System.Xaml.dll
Step into: Stepping over method without symbols 'System.Windows.Markup.WpfXamlLoader.Load'
Mon client de téléchargement est un client WPF, donc il ouvre un flux et l'envoie au service WCF (.svc) hébergé dans cassini –