all groups > dotnet web services > september 2006 >
You're in the

dotnet web services

group:

Size of Request to Webservice


Size of Request to Webservice Stanley Omega
9/30/2006 12:00:00 AM
dotnet web services: Hello,

I have a webservice that has a max httpRequest size of 85kb. I do not want
to change this.

I have been reducing the size of my datasets that Im sending to the
webservice until they come in under 85kb....or so i thought. I am using
xmlwrite.length to get the length in bytes <85 but i have found that the xml
serializer can blow the actual size fo the data tranfered much higher. For
instance a 47kb data using my method can blow out to 120kb??? What is the
reccomnded way of calculating the size of the data to be transferred so that
it can pass httpLength restriction?

Thanks


Re: Size of Request to Webservice Stanley Omega
10/1/2006 12:00:00 AM
Thank you Gaurav.

I am very silly. I was working around an artificial restriction. I did not
want images being uploaded to my website beyond 85kb. I used
<httpRuntime maxRequestLength="85"/>

to enforce this. That meant i couldn't upload datasets bigger than 85kb. Now
that i actually think about it and the power of the dotNet framework, i can
just add another web.config to my webservices directory that overrides this
setting
<httpRuntime maxRequestLength="500"/>

And now I get to have my cake and eat it too.

Thanks



"Gaurav Vaish (www.EduJiniOnline.com)"
[quoted text, click to view]

Re: Size of Request to Webservice Gaurav Vaish (www.EduJiniOnline.com)
10/1/2006 12:40:06 AM
[quoted text, click to view]

I don't think it would be possible before hand because of various reasons:

1. Namespace prefixes to be used would be unknown
2. Indentation needs to be taken care of
3. Encoding needs to be taken care of... though normally it's UTF-8.
4. You may not know what 'exact' data would be Xml-Serialized and their
namespaces (and may be new prefixes)...


--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------

AddThis Social Bookmark Button