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