We have an interesting problem with WCF binding and streaming, which we cannot solve:
We have a WCF endpoint configured for streaming mode. The endpoint receives the message much larger than the default size (~ 65KB). Therefore, we specified a larger message size in the maxReceivedMessageSize attribute in the anchor tag.
The problem is when we connect the endpoint and the binding with the bindingConfiguration attribute in the endpoint tag and the name attribute in the binding tag, we get the following error: "The remote server returned an error: (400) Bad Request."
Once we remove both the bindingConfiguration attributes and the name, it works without errors.
Here is the endpoint service definition:
<service name="Services.DocumentService" behaviorConfiguration="ServiceBehavior"> <endpoint contract="ServiceContracts.IDocumentService" address="DocumentService" binding="basicHttpBinding" name="basicHttpBinding" bindingConfiguration="BindingConfiguration" <---- when this goes away behaviorConfiguration="ServiceEndpointBehavior"/> <host> <baseAddresses> <add baseAddress="http://localhost:8080/Documents/"/> </baseAddresses> </host> </service>
Here is the binding configuration :
<binding name="BindingConfiguration" <---- and when this goes away transferMode="Streamed" maxReceivedMessageSize="2147483647" > <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding>
Thus, it only works as a default binding (without an explicit key). It is strange that we were able to verify by reflecting on the service host that the binding configuration was actually bound (maxReceivedMessageSize was set correctly) in both scenarios. Maybe this is a bug in WCF?
Self service
Any ideas really appreciated?
source share