473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

WebException HTTP 400 depending size of attachment

I have an application that send a file to a web service (I built both the
application and the web service)
I set the max file size via web.config of the web service:

<httpRuntime executionTimeout="1800"
maxRequestLength="5000"
/>

When the file size exceed 5000 (kb) I receive the right exception
(System.Web.Services.Protocols.SoapException) that tell me that the dimension
is incorrect.
If I try to reduce the timeout and my application exceed the timeout, also
in this case receive the right exception.

But when I send i file larger then 4096 kbyte and less than 5000 kb (or the
limit set in maxRequestLength) I receive a generic System.Net.WebException:
The request failed with HTTP status 400: Bad Request
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

There was a limit in SOAP message size or the limit is in IIS?

I looked for a limit in IIS metabase.xml and .config files but I found
nothing.
My Configuration is:
Windows 2003 (italian)
IIS 6.0
Web Services Enhancements 2.0 (on server and client)

Many thanks
Nov 23 '05 #1
4 7198
Hello vigori,
I believe teh default limit is 4096kb. And i dont know it at the top of
my head but its a property called RequestSizeLimit??!! in machine.config

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
I have an application that send a file to a web service (I built both
the
application and the web service)
I set the max file size via web.config of the web service:
<httpRuntime executionTimeout="1800"
maxRequestLength="5000"
/>
When the file size exceed 5000 (kb) I receive the right exception
(System.Web.Services.Protocols.SoapException) that tell me that the
dimension
is incorrect.
If I try to reduce the timeout and my application exceed the timeout,
also
in this case receive the right exception.
But when I send i file larger then 4096 kbyte and less than 5000 kb
(or the
limit set in maxRequestLength) I receive a generic
System.Net.WebException:
The request failed with HTTP status 400: Bad Request
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(Soap
ClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
There was a limit in SOAP message size or the limit is in IIS?

I looked for a limit in IIS metabase.xml and .config files but I found
nothing.

My Configuration is:
Windows 2003 (italian)
IIS 6.0
Web Services Enhancements 2.0 (on server and client)
Many thanks

Nov 23 '05 #2
Hello,
I have just looked for something sound like "maxsize", "sizelimit" etc. or
value equal to 4096 or 4194304 in machine.config and metabase.xml.
I think it's a setting but i would know where is.
I try to post this problem in many forums but nobody can solve it.

Thank you

"Dilip Krishnan" wrote:
Hello vigori,
I believe teh default limit is 4096kb. And i dont know it at the top of
my head but its a property called RequestSizeLimit??!! in machine.config

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
I have an application that send a file to a web service (I built both
the
application and the web service)
I set the max file size via web.config of the web service:
<httpRuntime executionTimeout="1800"
maxRequestLength="5000"
/>
When the file size exceed 5000 (kb) I receive the right exception
(System.Web.Services.Protocols.SoapException) that tell me that the
dimension
is incorrect.
If I try to reduce the timeout and my application exceed the timeout,
also
in this case receive the right exception.
But when I send i file larger then 4096 kbyte and less than 5000 kb
(or the
limit set in maxRequestLength) I receive a generic
System.Net.WebException:
The request failed with HTTP status 400: Bad Request
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(Soap
ClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
There was a limit in SOAP message size or the limit is in IIS?

I looked for a limit in IIS metabase.xml and .config files but I found
nothing.

My Configuration is:
Windows 2003 (italian)
IIS 6.0
Web Services Enhancements 2.0 (on server and client)
Many thanks


Nov 23 '05 #3
Hello vigori,

Quoted from another post
{{
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>
}}

Also
{{
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.
}}
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hello,
I have just looked for something sound like "maxsize", "sizelimit"
etc. or
value equal to 4096 or 4194304 in machine.config and metabase.xml.
I think it's a setting but i would know where is.
I try to post this problem in many forums but nobody can solve it.
Thank you

"Dilip Krishnan" wrote:
Hello vigori,
I believe teh default limit is 4096kb. And i dont know it at the top
of
my head but its a property called RequestSizeLimit??!! in
machine.config
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
I have an application that send a file to a web service (I built
both
the
application and the web service)
I set the max file size via web.config of the web service:
<httpRuntime executionTimeout="1800"
maxRequestLength="5000"
/>
When the file size exceed 5000 (kb) I receive the right exception
(System.Web.Services.Protocols.SoapException) that tell me that the
dimension
is incorrect.
If I try to reduce the timeout and my application exceed the
timeout,
also
in this case receive the right exception.
But when I send i file larger then 4096 kbyte and less than 5000 kb
(or the
limit set in maxRequestLength) I receive a generic
System.Net.WebException:
The request failed with HTTP status 400: Bad Request
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(So
ap
ClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
There was a limit in SOAP message size or the limit is in IIS?
I looked for a limit in IIS metabase.xml and .config files but I
found nothing.

My Configuration is:
Windows 2003 (italian)
IIS 6.0
Web Services Enhancements 2.0 (on server and client)
Many thanks

Nov 23 '05 #4
Hello,
thank you for your reply, but maxRequestLength dont solve the problem.
As I said in first post if I set maxRequestLength to 3000, max file size
that can be uploaded is 3000, but if I set maxRequestLength with I value
greater than 4096 max file size that can be uploade remain 4096. Obviusly the
values is in Kbyte.

Paolo Vigori

"Dilip Krishnan" wrote:
Hello vigori,

Quoted from another post
{{
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>
}}

Also
{{
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.
}}
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hello,
I have just looked for something sound like "maxsize", "sizelimit"
etc. or
value equal to 4096 or 4194304 in machine.config and metabase.xml.
I think it's a setting but i would know where is.
I try to post this problem in many forums but nobody can solve it.
Thank you

"Dilip Krishnan" wrote:
Hello vigori,
I believe teh default limit is 4096kb. And i dont know it at the top
of
my head but its a property called RequestSizeLimit??!! in
machine.config
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
I have an application that send a file to a web service (I built
both
the
application and the web service)
I set the max file size via web.config of the web service:
<httpRuntime executionTimeout="1800"
maxRequestLength="5000"
/>
When the file size exceed 5000 (kb) I receive the right exception
(System.Web.Services.Protocols.SoapException) that tell me that the
dimension
is incorrect.
If I try to reduce the timeout and my application exceed the
timeout,
also
in this case receive the right exception.
But when I send i file larger then 4096 kbyte and less than 5000 kb
(or the
limit set in maxRequestLength) I receive a generic
System.Net.WebException:
The request failed with HTTP status 400: Bad Request
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(So
ap
ClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
There was a limit in SOAP message size or the limit is in IIS?
I looked for a limit in IIS metabase.xml and .config files but I
found nothing.

My Configuration is:
Windows 2003 (italian)
IIS 6.0
Web Services Enhancements 2.0 (on server and client)
Many thanks


Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Derrick | last post by:
I have an http download that streams a zip file to client, after download I am getting "Error start of central directory not found; Zip file corrupt. Possible casue: file transfer error." Ring...
1
by: BTHOMASinOHIO | last post by:
I am confussed on what the heck is going on ?! I have an HTML INPUT File Box on an Email Piece of an application. I know that File Size is set to 4MB in the WebConfig File and that is fine, but I...
2
by: genc_ ymeri at hotmail dot com | last post by:
Hi, I'm trying to recieve the response status code rather than the message in the below code : try { responseArray = myWebClient.UploadValues(uriString,"POST",myNameValueCollection); }...
0
by: Matt | last post by:
(can't find any of my previous post for same issue. please CC to my email address as well. Thanks!) Hi all, What is the possible reason that HttpWebRequest.GetRequestStream() may hang there...
1
by: etantonio | last post by:
Good morning, I've a problem, in the past I translate my site from google or altavista with a code similar to this : <%@ Page Language="c#" Trace="true" Debug="true" %> <%@ import...
8
by: Tim Reynolds | last post by:
Our .Net application calls a web method of aplpication 2 that resides on their Apache server. When I as a developer C#, Studios 2003, make the call to their web method from my desktop, I receive no...
4
by: =?Utf-8?B?UGhpbGlwIEs=?= | last post by:
Simplifying the code a bit its like this: try { myRemotingObj.Myfunction(string, string,string,string,timeSpan) } catch(WebException) { commsUp = false; }
5
by: repairman2003 | last post by:
I am getting the following error when trying to call GetRequestStream(): System.Net.WebException: The requested URI is invalid for this FTP command.. Code where the exception catches: ......
2
by: Eric E | last post by:
Hello All - I am using python to send an email with a large zip file as an attachment. I successfully sent a 52M attachment. If I try to send a 63M attachment or larger, the message never gets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.