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 / .NET Framework / New Users / December 2005

Tip: Looking for answers? Try searching our database.

HttpWebRequest and obsoleted serialization constructor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ivan Peev - 03 Dec 2005 00:35 GMT
Hello,

I have question related to HttpWebRequest class, part of System.Net
namespace. Apparently in .NET 2.0 version, the one and only available from
outside constructor is now declared as obsolete (this is a dump from
Reflector):

[Obsolete("Serialization is obsoleted for this type.
http://go.microsoft.com/fwlink/?linkid=14202"),
SecurityPermission(SecurityAction.Demand, SerializationFormatter=true)]
protected HttpWebRequest(SerializationInfo serializationInfo,
StreamingContext streamingContext) : base(serializationInfo,
streamingContext)

I would like to ask the designers of the library why they are obsoleting
this constructor? So far I have found one very good use for it, to implement
my own compressed (gzip) HTTP web request extension. Permanently removing
this constructor will make this simple extension harder to accomplish.

My original reason for using this bizarre constructor was the inability to
use HttpWebRequest constructor with Uri parameter, which is defined as
internal for the assembly. This would have been much better fit for my
problem at hand.

Thank you for your time,
Ivan
Joerg Jooss - 03 Dec 2005 08:51 GMT
> Hello,
>
[quoted text clipped - 15 lines]
> extension. Permanently removing this constructor will make this
> simple extension harder to accomplish.

I can't claim credit for designing or implementing it, but to me it
seems you used an internal constructor as an extension point that was
never meant to be (it's sole purpose is to support the serialization
framework).

IMHO to implement compression/decompression support at the request
level is... wrong. Compression is a stream level property, so in order
to offer this kind of functionality, provide a stream decorator that
applies (de)compression to another stream.

BTW, (de)compression support has been added in .NET 2.0.

Cheers,
Signature

http://www.joergjooss.de
mailto:news-reply@joergjooss.de


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.