Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

What is the maximum SOAP request size?

Posted on 2004-11-17
8
Medium Priority
?
4,215 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:ppastor
  • 4
  • 3
8 Comments
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12604234
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
 

Author Comment

by:ppastor
ID: 12604412
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
 
LVL 17

Accepted Solution

by:
AerosSaga earned 2000 total points
ID: 12604595
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ppastor
ID: 12605110
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
 
LVL 28

Expert Comment

by:mmarinov
ID: 12605266
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
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12605294
I am beginning to think there is no application level control for max soap size post.
0
 

Author Comment

by:ppastor
ID: 12607175
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
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12607220
Your very welcome glad you got the issue resolved;)

Aeros
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question