0

I am struggling to understand what I am doing wrong. I have a simple interface that accepts an array. I can't make it to handle more than ~150 items - getting back 400 Bad Request. What am I doing wrong? Can anyone spot anything? I looked thru this post and it appears to be the answer but it doesn't work for me: WCF maxReceivedMessageSize not being read from config.

The service is hosted in IIS7 and uses .NET 3.5. Here is my web.config:

    <system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="MyService.basicHttpBinding" maxReceivedMessageSize="5000000" maxBufferSize="5000000">
                <readerQuotas maxStringContentLength="5000000" maxArrayLength="5000000" />
            </binding>          
        </basicHttpBinding>
    </bindings>

    <behaviors>
        <serviceBehaviors>
            <behavior name="MyService.Service1Behavior">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="true"/>
                <!-- Please set this to false when deploying -->
                <serviceDebug includeExceptionDetailInFaults="True" httpHelpPageEnabled="True"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>

    <services>
        <service behaviorConfiguration="MyService.Service1Behavior" name="MyService">
            <endpoint address="ws" binding="wsHttpBinding" contract="IMyService">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <endpoint binding="basicHttpBinding" bindingConfiguration="MyService.basicHttpBinding" contract="IMyService" />
        </service>
    </services>
</system.serviceModel>
Community
  • 1
  • 1
Schultz9999
  • 8,717
  • 8
  • 48
  • 87

2 Answers2

1

What's the config on the receiving end? I found the serializer blew up on receipt of lots of data.

IanT8
  • 2,167
  • 2
  • 23
  • 38
1

To troubleshoot turn on tracing both on the server and on the client, then inspect the log file. The error message points more to an object not being marked as [Serializable]. See http://msdn.microsoft.com/en-us/library/ms732023.aspx for guidance.

Dan
  • 1,927
  • 2
  • 24
  • 35
  • Apparently my client (WCFStorm) would pic WS binding, not httpBasic, which I didn't have any customization for. After I have removed WS bidning all together, the problem was solved. – Schultz9999 Jul 14 '11 at 07:15