Bonjour,
J’ai un e application web service
Un client Test et un serveur WCF
Mon client c’est une forme qui contient un mémo pour taper un text
Mon problème :
Quant je tape un text court ma sauvegarde se passe bien (c’est le serveur WCF qui s’occupe de la sauvegarde)
Quand j’au un long texte (plus de 6000 characters) le message ne se sauve pas
J’ai fait alors un WCF trace et j’ai trouvé l’erreur suivante :
Sachant que voici ma configuration :The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 9, position 275.
Coté client :
:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 WebRequest.DefaultWebProxy = null; WSHttpBinding binding = new WSHttpBinding(); binding.OpenTimeout = new TimeSpan(0, 1, 0); binding.ReceiveTimeout = new TimeSpan(0, 10, 0); binding.SendTimeout = new TimeSpan(0, 1, 0); binding.CloseTimeout = new TimeSpan(0, 1, 0); binding.BypassProxyOnLocal = true; binding.TransactionFlow = false; binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard; binding.MaxBufferPoolSize = 134217728; binding.MaxReceivedMessageSize = 134217728; binding.MessageEncoding = WSMessageEncoding.Text; binding.TextEncoding = Encoding.UTF8; binding.UseDefaultWebProxy = false; binding.ProxyAddress = null; binding.ReliableSession.InactivityTimeout = new TimeSpan(0, 10, 0); binding.ReliableSession.Ordered = true; binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows; binding.Security.Message.NegotiateServiceCredential = true; binding.Security.Message.AlgorithmSuite = SecurityAlgorithmSuite.Default; binding.ReaderQuotas.MaxArrayLength = 2097152; binding.ReaderQuotas.MaxDepth = 1024; binding.ReaderQuotas.MaxStringContentLength = 134217728; binding.ReaderQuotas.MaxNameTableCharCount = 2097152; binding.ReaderQuotas.MaxBytesPerRead = 134217728;
Coté serveur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <bindings> <wsHttpBinding> <binding name="wsHttpBinding" maxBufferPoolSize="134217728" maxReceivedMessageSize="134217728"> <readerQuotas maxArrayLength="2097152" maxDepth="1024" maxNameTableCharCount="2097152" maxStringContentLength="134217728" maxBytesPerRead="524288"/> </binding> </wsHttpBinding> </bindings>
Avez-vous une idée sur ce que peut se passer.
Merci d’avance pour votre aide.
Partager