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 9133511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:30:05+00:00 2026-06-17T08:30:05+00:00

I have the following wcf service method which takes Attachment object and the Attachment

  • 0

I have the following wcf service method which takes Attachment object and the Attachment class definition is:

    [DataContract]
    public class Attachment
    {
        [DataMember]
        public int AttachmentId { get; set; }
        [DataMember]
        public String DMSFileId { get; set; }
        [DataMember]
        public String FileName { get; set; }
        [DataMember]
        public int? FileSize { get; set; }
        [DataMember]
        public String FileSource { get; set; }
        [DataMember]
        public byte[] File { get; set; }
    }

And the method definition is :

[OperationContract]    
public int AddAttachment(DataTypes.Administration.Attachment attachment)
{
   return AttachmentBusinessLogic.AddAttachment(attachment);
}

When the method is called I get the following exception:
The remote server returned an unexpected response: (413) Request Entity Too Large

Googling the error I came across many binding configuration but none of them worked not the maxReceivedMessageSize nor the readerQuotas.

Here is the web config of both the service and the client:

Service

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
</system.serviceModel>

Client

    <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
        <behaviors>
          <endpointBehaviors>
            <behavior name="AdministrationBehavior">
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_IAdministrationService" sendTimeout="00:05:00"
                     openTimeout="00:05:00"
                     receiveTimeout="00:05:00"
                     maxReceivedMessageSize="2147483647"
                     maxBufferSize="2147483647"
                     maxBufferPoolSize="2147483647">
                <readerQuotas maxArrayLength="2147483647"
                              maxStringContentLength="2147483647" />
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:8001/AdministrationService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAdministrationService" contract="AdministrationService.IAdministrationService" name="BasicHttpBinding_IAdministrationService" behaviorConfiguration="AdministrationBehavior" />
    </client>
</system.serviceModel>

Any suggestion on how to overcome this exception please.

  • 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-06-17T08:30:06+00:00Added an answer on June 17, 2026 at 8:30 am

    I managed to solve it by following the steps to configure wcf web config file in another post.

    configuring WCF wtih tag

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

Sidebar

Related Questions

I have following method in wcf webenabled service Public Person AddPerson(Person p); As of
Given that I have the following WCF service: class LookUpService { public List<County> GetCounties(string
I have the following WCF DataContract: [DataContract] public class Occupant { private string _Name;
I have a wcf service which has a method as follow: public void SyncClient(List<Client>
I have a WCF-REST service with one method which returns a string: [ServiceContract] public
Greetings, I have to following problem. I have a WCF Service which runs under
I have WCF service with IParameterInspector class which suppose to store the message for
I have the following function (which is hosted in a WCF service, if that
I have the following classes: [DataContract] [KnownType(typeof(SpecifiedItemCollection))] public class ItemCollection<T> : IEnumerable where T
I have the following data model: I am writing a WCF service that needs

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.