I have an instance of System.Web.Services.WebService with a [WebMethod] returning an instance of class A. Class A is defined below. I would like the property a to be serialized but it is not. It seems only fields are serialized. Is there any way to force the property to be serialized?
public class A
{
private string _a;
public string a { get { return _a; } }
}
Serialization requires that both the Setter and the Getter accessors are present.