What is the maximum SOAP request size?

I am looking for a clear answer.

In the .NET documentation it states that you can set the maximum request size by using the httpRuntime element in the web.config, and that the default is 4MB.

I have also read in the SOAP SDK that the default maxPostSize is 100KB, and that this is controlled by a registry setting:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSOAP\SOAPISAP

The behavior that I am observing would indicate that the SOAP SDK is correct, because as I try to pass a byte array larger than 100K to my web service, I do receive a SOAP exception. So, my question is this...

Can I change this behavior through the web.config? I do not want to allow large posts for the entire IIS web server, just for a specific virtual directory. It would seem that a registry setting will not meet these requirements.

Your prompt reply is greatly appreciated!

Phil
ppastorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AerosSagaCommented:
If you want to make it higher you can do some by editing  your application's local web.config file and setting
the "maxRequestLength" attribute on the httpRuntime section handler (the
value is the number of KBytes to support -- so 8000 would be around Mb).

<configuration>

<system.web>

<httpRuntime maxRequestLength&#"8;000"/>

</system.web>

</configuration>

http://authors.aspalliance.com/aspxtreme/aspnet/syntax/httpruntimesection.aspx

Aeros
0
ppastorAuthor Commented:
Aeros,

Thank you for the reply.

I neglected to state in my question that while the default maxRequestLength is 4MB...I am experiencing problems with byte arrays that are smaller than 4MB, yet larger than the 100KB limit for SOAP's maxPostSize.

Does this make sense?

Phil
0
AerosSagaCommented:
perhaps your machine.config is not allowing you to overide the httpruntime settings?  Are you able to view the servers Machine.config?

Locking Configuration Settings

To prevent individual applications from overriding machine-level policy configuration, place settings within a <location> element in Machine.config and set the allowOverride="false" attribute.

For example, to apply machine-wide policy that cannot be overridden at the application level, use the following <location> element:

<location path="" allowOverride="false">
  <system.web>
    … machine-wide defaults
  </system.web>
</location>

By leaving the path attribute empty, you indicate that the settings apply to the machine, while allowOverride="false" ensures that Web.config settings do not override the specified values. Any attempt to add elements in Web.config will generate an exception, even if the elements in Machine.config match with those of Web.config.

http://msdn.microsoft.com/security/default.aspx?pull=/library/en-us/dnnetsec/html/thcmch19.asp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

ppastorAuthor Commented:
Aeros,

Thanks again for the reply.

Let me attempt to be clearer...

I have checked the machine.config...the "allowOverride" is set to true...and, the httpRuntime maxRequestLength="4096".
In my application's web.config I am NOT overriding the httpRuntime, so therefore, it should be inheriting the maxRequestLength of 4MB...correct?

yet, I am not able to post a byte array larger than 100KB...what am I missing?

Phil
0
mmarinovCommented:
Hi ppastor,

have you checked if you change the size in the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSOAP\SOAPISAP
if you be able to post more than 100k

i believe that you will be able, unofrtunately this will be settings for the complete web server but not only for your application

Regards!
B..M
mmarinov
0
AerosSagaCommented:
I am beginning to think there is no application level control for max soap size post.
0
ppastorAuthor Commented:
Aeros,

Thanks again for all of your help.

It turns out that I was being stupid (again).

I was converting a JPG image to a byte array, but using the BMP encoder. So, what I thought was a 120KB image was being turned into a 22MB byte array!! So, I started using the JPEG encoder, and the byte array sizes were much more reasonable.

Therefore, the lesson learned from this (besides the fact that you should use the proper encoder), is that the size limit for the SOAP post IS controlled by the httpRuntime element's "maxRequestLength" attribute. Just to be sure, I did add an httpRuntime element to my app's web.config, and set it to something small, and then I saw the same exceptions again.

Thanks again!

Phil
0
AerosSagaCommented:
Your very welcome glad you got the issue resolved;)

Aeros
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.