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 / April 2005

Tip: Looking for answers? Try searching our database.

Object Serialization

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian - 26 Apr 2005 18:23 GMT
Hi,

I'm a newbie to XML Web Services I have a class written in C# with a few
string properties that i want to expose as xml from a web service.

Whenever i try this i just get something like this:

<?xml version="1.0" encoding="utf-8" ?>
<CLASSNAME xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.namespace.com/Webservices/" />

None of the properties are visible.

How do i make it so the properties are xml nodes?

EG. the properties:

public string prop1
{
get { return "val1"}
}

public string prop2
{
get { return "val2"}
}

would be exposed as:

<prop1>val1</prop1>
<prop2>val2</prop2>

Thanks.
Ingo Eichenseher - 27 Apr 2005 07:21 GMT
Hi

i think only public properties with get _and_ set methods
will be serialized.

Ingo
Champika Nirosh - 27 Apr 2005 08:45 GMT
Indeed you are correct .. get method needed when serializing the object..
and set method needed when deserialize the object .... inorder to transfer a
data object successfully u need to have both methods implemented in your
data class...

Nirosh.

> Hi
>
> i think only public properties with get _and_ set methods
> will be serialized.
>
> Ingo

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.