views:

67

answers:

3

Hi!

I want to send a big XML string to a WCF SVC service from Silverlight.

It looks like anything under about 50k is sent correctly but if I try to send something over that limit, my request reaches the server (BeginRequest is called) but never reaches my SVC. I get the classic "NotFound" exception.

Any idea on how to raise that limit?

If I can't raise it? What are my other options?

Here's my binding configuration

<bindings>
        <customBinding>
            <binding name="customBinding0" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />

      </binaryMessageEncoding>
                <httpTransport/>
            </binding>
            <binding name="customBindingSecure" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />
                </binaryMessageEncoding>
                <httpsTransport/>
            </binding>
        </customBinding>
    </bindings>

Edit: More details : If I break in the Global.asax Endrequest, I see in the Response "Bad Request 400"

Edit: More details again : I activated the Trace and I can see the following error : The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

However, my maxReceivedMessageProperty is already set to 2147483647

Thanks, Alex

A: 

see this answer regarding increasing message size, that may help

Pharabus
Thanks but the answer is about receiving large data. In my case receiving works, it's sending it back that causes the problem.
alexbf
@alexbf did you apply this to the web.config on the server as well as the client?
Pharabus
@Pharabus I did on the web.config of the server. On the client, when I call my wcf service, I set the values programmatically... httpTransport.MaxReceivedMessageSize = 2147483647;httpTransport.MaxBufferSize = 2147483647;I am pretty sure the problem is on the server because the code reached the Begin request and I can see the Requests size is okay.
alexbf
A: 

Try this in the app.config/web.config on the server side:

<system.web>
    <httpRuntime maxRequestLength="109200" executionTimeout="3600" />
</system.web>
Bob Manz
A: 

Ok got it working!

Since I am using a customBinding, the maxReceivedMessageSize has to be set on the httpTransport element like this :

<bindings>
        <customBinding>
            <binding name="customBinding0" >
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />

      </binaryMessageEncoding>
                <httpTransport maxReceivedMessageSize="4194304" />
            </binding>
            <binding name="customBindingSecure">
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />
                </binaryMessageEncoding>
                <httpsTransport  maxReceivedMessageSize="4194304" />
            </binding>
        </customBinding>
    </bindings>

Thank you all for your help!

alexbf