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 / General / March 2008

Tip: Looking for answers? Try searching our database.

Serializing Object Model

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave T - 24 Mar 2008 17:07 GMT
From a web service I'm serializing out an object model.  Is there a way to
only include those elements of the object model which actually contain data?
PJ6 - 24 Mar 2008 17:45 GMT
> From a web service I'm serializing out an object model.  Is there a way to
> only include those elements of the object model which actually contain
> data?

It can be done, you will need a to write custom serializer for for that.
I've written one before and don't remember it being too difficult.

If you do that, though, you may have trouble deserializaing the result to
any wsdl-generated classes you may be using on the consumer side. To get
around that you could break down the object in question into a hierarchy of
classes; in that case you could probably eliminate your need for a custom
serializer to crop away empty fields altogether if you're dealing with a
broad yet deep tree of data.

All that being said: if your reason for doing this is size, I wouldn't
bother; 99% of the time doing this would be poor design, and if you turn on
(or manually implement) compression you'll find that XML data shrinks by a
factor of 30 because of its high tokenization.

Paul

Rate this thread:







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.