Message Length for an ASP.NET webservice

S

Stevet96

I have a webservice running using ASP.NET. The webservice has several
functions that have been tested and work great. However, I have one function
that is returning a rather large chunk of data back to the client. When I
try to return the data to the client , the client is getting the following
error message:

"Server Error in '/WebServiceName' Application."
"The underlying connection was closed: The limit set on the message length
was exceeded."

I then see a trace dump on the client side. My question is 2 fold. What is
the default message length limit set by ASP.NET on IIS 5.0 and how do I
change the message limit.

Currently I am accessing the webservice using an ASP.NET webpage.

Thanks,
Steve
 
E

Erymuzuan Mustapa

the default length is 4096 k , you can increase that in config file as
follows <httpRuntime executionTimeout="90" maxRequestLength="4096" ....

Regards
Erymuzuan Mustapa
 
S

Stevet96

Erymuzuan,

Unfortunately, the maxRequestLength does not seem to be the problem. I
added the maxRequestLength to both the service and the client and bumped it
up to 8192. However I got the same error message. I know that the message
that I am sending back can not be even close to 8 meg because it is all
strings and ints. I decided to look into the exact size of the object and
try to capture the soap that was being generated to see how much data I was
really sending.

To do this, I used the SoapFormatter class found in
System.Runtime.Serialization.Formatters.Soap. I then serialized my object
and wrote it out to a file. The actual size that is being sent is 433k. Far
from the 8 meg or even 4 meg limit.

It would seem to me that the maxRequestLength would only pertain to the
Request object and the data sent during the request. Is the Response object
for sure limited by the maxRequestLength or is there another setting that I
need to adjust?

Again, I am sending a 433k SOAP message from a webservice. I tried sniffing
the IP traffic from the server and it appears that the webservice is
generating the message length exception because I never see the soap message
transmitted over the network.

I tried searching for the exact exception message that I am getting and I
can't even find it on Microsoft's website or MSDN. Has anyone else seen this
exact same error message?

Any other ideas or suggestions?
Thanks,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top