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 2004

Tip: Looking for answers? Try searching our database.

How do I get serialized object?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ddt - 02 Nov 2004 16:45 GMT
Hi,
I have a class with some properties. When I return the object from Web
Services, it automatically serialized to XML format. My question is how can I
get that serialized XML of the object (not from client side, I want to get it
from server side itself)?

Many thanks,
ddt
Drew Marsh - 02 Nov 2004 17:14 GMT
> Hi,
> I have a class with some properties. When I return the object from Web
[quoted text clipped - 5 lines]
> Many thanks,
> ddt

It's just using the XmlSerializer to do it's work, so you can do the same. The simplest example I can think of:

<codeSnippet language="C#">
XmlSerializer serializer = new XmlSerializer(typeof(YourTypeHere))

StringWriter writer = new StringWriter();

serializer.Serialize(writer, yourInstance);

Debug.WriteLine(writer.ToString());
</codeSnippet>

HTH,
Drew
ddt - 02 Nov 2004 18:06 GMT
Thanks a lot Drew.
ddt

> > Hi,
> > I have a class with some properties. When I return the object from Web
[quoted text clipped - 20 lines]
> HTH,
> Drew

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.