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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:06:55+00:00 2026-05-23T03:06:55+00:00

I am having some issue configuring the maxRecievedMessageSite property of a basicHttpBinding . I

  • 0

I am having some issue configuring the maxRecievedMessageSite property of a basicHttpBinding. I want to create an endpoint to upload potentially large files however the current (I assume default) restriction is 64K. For items such as images and large documents, this limit just won’t work. I have created a new binding from the basicHttpBinding but i keep getting errors in the stack trace letting me know that I have exceeded the limit. Below I have included the relavent parts from my configuration file, Global.asax file, my operational contract, and my service implementation. (all very simple, just trying to get it to work).

Configuration File

<system.webServer>
  <system.serviceModel>
    <services>
      <!-- CarImage Service Configuration -->
      <service name="CarImageService">
        <endpoint address="" 
                  binding="basicHttpBinding" 
                  bindingConfiguration="FileTransferServicesBinding"
                  contract="ICarImageService" />
      </service>
    </services>

    <bindings>
      <basicHttpBinding>
        <!-- buffer: 64KB; max size: 64MB -->
        <binding name="FileTransferServicesBinding"
                 closeTimeout="00:01:00"
                 openTimeout="00:01:00"
                 receiveTimeout="00:01:00"
                 sendTimeout="00:01:00"
                 transferMode="Streamed"
                 messageEncoding="Mtom"
                 maxBufferSize="999999"
                 maxReceivedMessageSize="67108864"
                 maxBufferPoolSize="99999">
           <security mode="None" >
            <transport clientCredentialType="None" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

</system.serviceModel>

Global.asax File

namespace Mavizon.Mavia.Services
{
    public class Global : HttpApplication
    {
        private string FilePath = ConfigurationManager.AppSettings["ImageFolder"];

        void Application_Start(object sender, EventArgs e)
        {
            if (!Directory.Exists(FilePath))
            {
                Directory.CreateDirectory(FilePath);
            }
            RegisterRoutes();
        }

        private void RegisterRoutes()
        {
            RouteTable.Routes.Add(new ServiceRoute("test", new WebServiceHostFactory(), typeof(CarImageService)));
        }
    }
}

Operational Contract

namespace Mavizon.Mavia.Services.OperationContracts
{
    [ServiceContract]
    public interface ICarImageService
    {
        [OperationContract]
        [FaultContract(typeof(ErrorFault))]
        [WebInvoke(Method = "POST", UriTemplate = "/")]
        void UploadImage(Stream request);
    }
}

My (very) Simple implementation class

namespace Mavizon.Mavia.Services.WebServices
{
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class CarImageService : OperationContracts.ICarImageService
    {
        public void UploadImage(Stream request)
        {

        }
    }
}

** Here is my stack trace informaiton **

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.
<StackTrace>   
   at System.ServiceModel.Channels.HttpInput.ThrowHttpProtocolException(String message, HttpStatusCode statusCode, String statusDescription)
   at System.ServiceModel.Channels.HttpInput.ThrowMaxReceivedMessageSizeExceeded()
   at System.ServiceModel.Channels.HttpInput.GetMessageBuffer()
   at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception&amp;amp; requestException)
   at System.ServiceModel.Channels.HttpRequestContext.CreateMessage()
   at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, Action callback)
   at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
   at System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state)
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object state)
   at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace><ExceptionString>System.ServiceModel.ProtocolException: 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.</ExceptionString><DataItems><Data><Key>System.ServiceModel.Channels.HttpInput.HttpStatusCode</Key><Value>BadRequest</Value></Data></DataItems></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:56:04.3623047Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{c05370d6-4c2f-4320-882f-365bf055e88f}" RelatedActivityID="{1782abf6-9c78-487d-91b0-29586d6140ad}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Stop">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:56:04.3623047Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{c05370d6-4c2f-4320-882f-365bf055e88f}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Stop"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>f5dae6e-2-129526377562529297</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Processing message 1.</ActivityName><ActivityType>ProcessMessage</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Resume">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:56:04.3623047Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{1782abf6-9c78-487d-91b0-29586d6140ad}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Resume"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>f5dae6e-2-129526377562529297</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Listen at 'http://localhost:2947/test'.</ActivityName><ActivityType>ListenAt</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:59:36.5878906Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" RelatedActivityID="{a7f8d8f5-ff82-4283-9ea2-4eb8a55a51a5}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Start">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:59:36.5878906Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{a7f8d8f5-ff82-4283-9ea2-4eb8a55a51a5}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Start"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>f5dae6e-2-129526377562529297</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Close ServiceHost 'Mavizon.Mavia.Services.WebServices.CarImageService'.</ActivityName><ActivityType>Close</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:59:36.5878906Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{a7f8d8f5-ff82-4283-9ea2-4eb8a55a51a5}" RelatedActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Stop">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:59:36.5878906Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{a7f8d8f5-ff82-4283-9ea2-4eb8a55a51a5}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Stop"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>f5dae6e-2-129526377562529297</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Close ServiceHost 'Mavizon.Mavia.Services.WebServices.CarImageService'.</ActivityName><ActivityType>Close</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:59:36.5878906Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{a7f8d8f5-ff82-4283-9ea2-4eb8a55a51a5}" RelatedActivityID="{1782abf6-9c78-487d-91b0-29586d6140ad}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:59:36.5878906Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{1782abf6-9c78-487d-91b0-29586d6140ad}" RelatedActivityID="{a7f8d8f5-ff82-4283-9ea2-4eb8a55a51a5}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Stop">0</SubType><Level>255</Level><TimeCreated SystemTime="2011-06-15T18:59:36.5878906Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{1782abf6-9c78-487d-91b0-29586d6140ad}" /><Execution ProcessName="WebDev.WebServer40" ProcessID="2268" ThreadID="5" /><Channel/><Computer>JOHNMURRAY027D</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Stop"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>f5dae6e-2-129526377562529297</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Listen at 'http://localhost:2947/test'.</ActivityName><ActivityType>ListenAt</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent>

** And the raw request that I am making is as follows **

POST http://localhost:2947/test/ HTTP/1.1
User-Agent: Fiddler
Host: localhost:2947
Content-Length: 150732

/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgDAgQAAwERAAIRAQMR...(on and on and on..lol)

Any help is greatly appreciated!

  • 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-23T03:06:56+00:00Added an answer on May 23, 2026 at 3:06 am

    Two problems:

    1. You’re using WCF configuration for your service endpoint with an address of “”, but then using code to spin the service up using ASP.NET routing at an address of “/test”. You should just need to align the config address with the routing address for the endpoint configuration to be picked up.

    2. You’re configuring your service with a basicHttpBinding, but at runtime you’re specifying WebServiceHostFactory which will use a webHttpBinding (i.e. REST support). You want to change your config to webHttpBinding. You would have gotten this error next had it found the endpoint for your service because the binding types would have mismatched.

    UPDATE

    I realized this morning that #1 was bad advice. You can’t actually mix/match WCF service/endpoint configuration with ServiceRoute registration. So you have two options to apply a specific binding configuration to your ServiceRoutes:

    1. Configure a default for webHttpBinding. This is definitely the easiest way to do it as it’s all config and no code changes required to what you’re already doing. See below for an example of this.

    2. Write custom WebServiceHostFactory and WebServiceHost subclasses where you then override the creation of the host and configure the specific binding information you want. This is a better approach when you’re going to be writing a bunch of service projects since, instead of all the projects having to all make sure to make the correct configuration entries are applied, they can just share the factory implementation via reference and just do new MyWebServiceHostFactory().

    Example default binding config:

    <system.serviceModel>
        <bindings>
            <webHttpBinding>
                <!-- no name attribute on a binding means it's the default for the biding type -->
                <binding transferMode="Streamed"
                         maxReceivedMessageSize="67108864">
                   <!-- other config here -->
                </binding>
            </webHttpBinding>
        </bindings>
    </system.serviceModel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to upload files in JSP/Servlet? I'm having some strange issue with
I am having some problems figuring out this issue. I have a server that
I'm having an issue getting some code to work. Is there a way to
I am having a strange issue with some of my packages in the same
I'm having an issue with a query I wrote where for some reason the
We are having some issue with our relative path in wordpress. Earlier our application
I'm having some issue with var_dump.i'm using xampp 1.7.3 on windows. I think in
I'm building a Curl web automation app and am having some issue with not
I am having some performance issue of linq compiled query. using (var txn =
I am having some speed issue with my datatables. In this particular case I

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.