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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:58:43+00:00 2026-05-23T18:58:43+00:00

I have a project with requirements to generate a single executable file with no

  • 0

I have a project with requirements to generate a single executable file with no dependencies that will automate the submission of data to a WCF service based on command line parameters passed to it. As a result, I cannot configure the WCF binding and quotas in an App.config file, so I am generating a BasicHttpBinding in code to use when dimensioning the WCF client object.

However, the WCF service accepts the binary data for a relatively small Excel spreadsheet that ends up being around 30kb, so the default configuration settings for the binding’s ReaderQuotas are inadequate. My attempts to increase them in code to 1MB, however, have met with failure each time I make a call to the service.

I have attempted to set the binding in the following two ways, first in the constructor itself:

Private theBinding As New BasicHttpBinding With {
    .SendTimeout = TimeSpan.FromMinutes(1),
    .OpenTimeout = TimeSpan.FromMinutes(1),
    .CloseTimeout = TimeSpan.FromMinutes(1),
    .ReceiveTimeout = TimeSpan.FromMinutes(10),
    .AllowCookies = False,
    .BypassProxyOnLocal = False,
    .HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
    .MessageEncoding = WSMessageEncoding.Text,
    .TransferMode = TransferMode.Buffered,
    .UseDefaultWebProxy = True,
    .MaxBufferSize = 1048576,
    .MaxReceivedMessageSize = 1048576,
    .ReaderQuotas = New XmlDictionaryReaderQuotas With {
        .MaxDepth = 32,
        .MaxStringContentLength = 8192,
        .MaxArrayLength = 1048576,
        .MaxBytesPerRead = 4096,
        .MaxNameTableCharCount = 16384
    }
}

And also by removing the ReaderQuotas setter in the above code and setting it to max values using System.Reflection on form load. I realize this method is more for bindings that have been created in a config file and are therefore typically immutable, but I figured it couldn’t hurt to try:

theBinding.GetType.GetProperty("ReaderQuotas").SetValue(theBinding, XmlDictionaryReaderQuotas.Max, Nothing)

The WCF client is dimensioned using the final overload for WCF client constructors:

Using theClient As New WCFServiceClient(theBinding, theEndpoint)
    ...
End Using

However, I still receive the following exception when making a call to the WCF client:

System.ServiceModel.ProtocolException: The formatter threw an exception while trying to deserialize the message: There was an error
while trying to deserialize parameter http://tempuri.org/:theObject.
The InnerException message was ‘There was an error deserializing the
object of type RootNameSpace.ObjectType. The maximum array length
quota (16384) has been exceeded while reading XML data. This quota may
be increased by changing the MaxArrayLength property on the
XmlDictionaryReaderQuotas object used when creating the XML reader.
Line 1, position 46272.’. Please see InnerException for more details.

Head is meeting desk. Could really use some guidance for what I may have missed here when it comes to properly configuring reader quotas.

  • 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-23T18:58:44+00:00Added an answer on May 23, 2026 at 6:58 pm

    Check your service’s configuration file (if it has one) or the settings on the binding its using. It’s possible the client is sending the message just fine but the service is rejecting it because it’s still using the default values.

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

Sidebar

Related Questions

I have a project where the requirements is that a end user will select
So I have a project and we have some data access requirements. This is
I just got off a small project using a WCF/REST Web Service that used
I have a project with requirements: Clients connect to server through internet (WAN) to
I’m working on a project and have developed the high level user requirements for
I'm considering using Grails for my current project. I have a couple of requirements
In our project we have requirement that, after receiving sms message from third party
In our project we have a requirement that when a set of records are
I have a requirement on my current project (a Flex app which will be
I'm a newbie to iOS programming, I have a project and my requirements are

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.