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

  • SEARCH
  • Home
  • 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 309303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:43:46+00:00 2026-05-12T07:43:46+00:00

I have a WCF Service operation which takes an object as a parameter. This

  • 0

I have a WCF Service operation which takes an object as a parameter. This object has a byte[] property among others. A Client program calls this service operation using a svcutil generated proxy.

when client program populates the object’s bype[] propery with size more than 50Kb it throws following error. (while an image size smaller than 50kb assigned to the byte[], it works).

The error which I am getting is:

System.ServiceModel.ProtocolException was unhandled
Message=”The remote server returned an unexpected response: (400) Bad Request.”

This is my Server side Config:

<system.serviceModel>
<diagnostics>
   <messageLogging logMalformedMessages="false" logMessagesAtServiceLevel="false"
    logMessagesAtTransportLevel="false" />
</diagnostics>
<services>
  <service behaviorConfiguration="ProjectABC.ABCServiceBehavior"
    name="ProjecXAPI.ContentService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="testContentBinding"
         bindingName="testContentBinding" contract="ProjectABC.IABCtService" />
        <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="higherMessageSize_MEX"
         contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
    <serviceBehaviors>
        <behavior name="ProjectABC.ABCServiceBehavior">
            <serviceMetadata httpGetEnabled="true"/>
                  <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
    </serviceBehaviors>
</behaviors>
<bindings>
  <basicHttpBinding>
    <binding name="testContentBinding" messageEncoding="Mtom" transferMode="Buffered">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
                    maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="None"></security>
    </binding>
  </basicHttpBinding>
  <mexHttpBinding>
    <binding name="higherMessageSize_MEX"/>
  </mexHttpBinding>
</bindings>
</system.serviceModel>

This is my Client side Config:

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="testContentBinding_IContentService" closeTimeout="01:01:00"
        openTimeout="01:01:00" receiveTimeout="01:10:00" sendTimeout="01:01:00"
        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
        maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
        messageEncoding="Mtom" textEncoding="utf-8" transferMode="Buffered"
        useDefaultWebProxy="true">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
          maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
            realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>

<client>
  <endpoint address="http://localhost:2361/Content/ContentService.svc"
            binding="basicHttpBinding" bindingConfiguration="testContentBinding_IContentService"
            contract="IContentService" name="testContentBinding_IContentService" />
</client>
</system.serviceModel>
  • 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. Editorial Team
    Editorial Team
    2026-05-12T07:43:47+00:00Added an answer on May 12, 2026 at 7:43 am

    Ok, I am answering my own question here –

    Just found out that there is a setting on in server side config “maxReceivedMessageSize”. Once you set this to the max size you want server to accept, you are ready to go.

    Thanks & Regards,
    Ajay

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

Sidebar

Related Questions

I created a simple WCF application which expose one operation. This operation takes a
I have a WCF service, which expose multiple operation contracts. One contract is to
I have an Operation Contract in my WCF service which returns an instance of
I have a WCF service which will be hosted under IIS. Now I have
We have an application that has a WCF service (*.svc) running on IIS7 and
I have a Windows Service Application in which i create WCF services in it.
I have a WCF service that I have to reference from a .net 2.0
I have a WCF service hosted for internal clients - we have control of
I have a WCF service and I want to expose it as both a
I have a WCF service running on the IIS with a ServiceHostFactory. It's running

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.