Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 180537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:36:14+00:00 2026-05-11T14:36:14+00:00

I’ve encountered this apparently common problem and have been unable to resolve it. If

  • 0

I’ve encountered this apparently common problem and have been unable to resolve it.

If I call my WCF web service with a relatively small number of items in an array parameter (I’ve tested up to 50), everything is fine.

However if I call the web service with 500 items, I get the Bad Request error.

Interestingly, I’ve run Wireshark on the server and it appears that the request isn’t even hitting the server – the 400 error is being generated on the client side.

The exception is:

System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (400) Bad Request. —> System.Net.WebException: The remote server returned an error: (400) Bad Request.

The system.serviceModel section of my client config file is:

 <system.serviceModel>     <bindings>         <wsHttpBinding>             <binding name="WSHttpBinding_IMyService" closeTimeout="00:01:00"                 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"                 bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"                 maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"                 messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"                 allowCookies="false">                 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="2147483647"                     maxBytesPerRead="4096" maxNameTableCharCount="16384" />                 <reliableSession ordered="true" inactivityTimeout="00:10:00"                     enabled="false" />                 <security mode="None">                     <transport clientCredentialType="Windows" proxyCredentialType="None"                         realm="" />                     <message clientCredentialType="Windows" negotiateServiceCredential="true"                         establishSecurityContext="true" />                 </security>             </binding>         </wsHttpBinding>     </bindings>     <client>         <endpoint address="http://serviceserver/MyService.svc"             binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService"             contract="SmsSendingService.IMyService" name="WSHttpBinding_IMyService" />     </client> </system.serviceModel> 

On the server side, my web.config file has the following system.serviceModel section:

<system.serviceModel>     <services>         <service name="MyService.MyService" behaviorConfiguration="MyService.MyServiceBehaviour" >             <endpoint address="" binding="wsHttpBinding" bindingConfiguration="MyService.MyServiceBinding" contract="MyService.IMyService">             </endpoint>             <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>         </service>     </services>     <bindings>       <wsHttpBinding>         <binding name="MyService.MyServiceBinding">           <security mode="None"></security>         </binding>       </wsHttpBinding>     </bindings>     <behaviors>         <serviceBehaviors>             <behavior name="MyService.MyServiceBehaviour">                 <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->                 <serviceMetadata httpGetEnabled="true"/>                 <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->                 <serviceDebug includeExceptionDetailInFaults="true"/>             </behavior>         </serviceBehaviors>     </behaviors> </system.serviceModel> 

I’ve looked at a fairly large number of answers to this question with no success.

Can anyone help me with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:36:14+00:00Added an answer on May 11, 2026 at 2:36 pm

    Try setting maxReceivedMessageSize on the server too, e.g. to 4MB:

    <binding name="MyService.MyServiceBinding" maxReceivedMessageSize="4194304"> 

    The main reason the default (65535 I believe) is so low is to reduce the risk of Denial of Service (DoS) attacks. You need to set it bigger than the maximum request size on the server, and the maximum response size on the client. If you’re in an Intranet environment, the risk of DoS attacks is probably low, so it’s probably safe to use a value much higher than you expect to need.

    By the way a couple of tips for troubleshooting problems connecting to WCF services:

    • Enable tracing on the server as described in this MSDN article.

    • Use an HTTP debugging tool such as Fiddler on the client to inspect the HTTP traffic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 86k
  • Answers 86k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer i tried it with the autoincrementseed and autoincrementstep and it… May 11, 2026 at 5:18 pm
  • Editorial Team
    Editorial Team added an answer Trying specifying the path by replacing "*firefox" with "*firefox /path/to/firefox-bin". May 11, 2026 at 5:18 pm
  • Editorial Team
    Editorial Team added an answer I think the difference between SQL's and .NET's Date data… May 11, 2026 at 5:18 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.