I am sending an object through a webservice with readonly methods.
I am using the Iserializable interface, assuming that I would no longer need a parameterless constructor. This is not true and I still cannot send my object over the wire.
public class Foo: ISerializable
{
public boolean IsBusy { get; private set;}
protected Foo(SerializationInfo info, StreamingContext context)
{
this.IsBusy = info.GetBoolean("IsBusy");
}
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
.AddValue("IsBusy", this.IsBusy);
}
Not quite sure what a read-only method is. But ISerializable only works for binary serialization. A web service uses XML serialization, a parameter-less constructor is required.
One trick you could use is to attribute it so that client code can never use it directly: