2006-02-01

Serialising doesn't work for read-only properties in webservices

I have been puzzled by the behavior of my webservice. I have a couple of properties in an object that is sent as a parameter to the webservice. Since these properties are not assigned directly by any code, I didn't implement a "set" method for the properies. (As it turns out: Bad mistake!)

What happened was that the values were set in the client to "true", but when the object arrived inside the webservice, the values were suddenly "false".

It turns out, if you don't implement both "get" and "set" for a property, it will not be serialised.

No comments:

Post a Comment