Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2007

Tip: Looking for answers? Try searching our database.

HttpException: Maximum request length exceeded

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Schmitz - 25 Dec 2006 12:47 GMT
HI,

in one of my webservices I need to provide a string to the consuming
application that can become really large (depending on user input).
Unfortunately, if the string becomes too long, the following error occurrs:

System.Web.Services.Protocols.SoapException was unhandled
 Actor=""
 Lang=""
 Message="System.Web.Services.Protocols.SoapException: There was an
exception running the extensions specified in the config file. --->
System.Web.HttpException: Maximum request length exceeded.
  at System.Web.HttpRequest.GetEntireRawContent()
  at System.Web.HttpRequest.get_InputStream()
  at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
  --- End of inner exception stack trace ---
  at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
  at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)"
 Node=""
 Role=""
 Source="System.Web.Services"
 StackTrace:
      at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
      at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
     
How can I transport this string anyway - especially as I cannot limit the
string length?

Best wishes,

Peter
Manish Bafna - 26 Dec 2006 04:58 GMT
Hi,
You can set it in the web.config file with:
<httpRuntime maxRequestLength="9000"></httpRuntime>

The above will set it to 9 mb

Thanks and Regards,
Manish Bafna.
MCP and MCTS.

> HI,
>
[quoted text clipped - 31 lines]
>
> Peter
Manish Bafna - 26 Dec 2006 05:30 GMT
Hi,

CAUSE
This problem occurs because the default value for the maxRequestLength
parameter in the <httpRuntime> section of the Machine.config file is 4096 (4
megabytes). As a result, files that are larger than this value are not
uploaded by default.  

RESOLUTION
To resolve this problem, use one of the following methods: • In the
Machine.config file, change the maxRequestLength attribute of the
<httpRuntime> configuration section to a larger value. This change affects
the whole computer.
• In the Web.config file, override the value of maxRequestLength for the
application. For example, the following entry in Web.config allows files that
are less than or equal to 8 megabytes (MB) to be uploaded:<httpRuntime
maxRequestLength="8192" />
                   
References : http://support.microsoft.com/default.aspx?scid=kb;EN-US;295626

Thanks and Regards,
Manish Bafna.
MCP and MCTS.

> HI,
>
[quoted text clipped - 31 lines]
>
> Peter
Narayanan - 21 Nov 2007 06:22 GMT
> HI,
>
[quoted text clipped - 31 lines]
>
> Peter

Thanks it's working fine...

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.