I have webservice that returns a list of a object, this object contains a field like below
public Object Owner = null;
When I call the webserice, I get error, but the error gone if I comment out the above code. So I believe it is about serialize of the Owner, I am thinking if I can exclude the Owner from the return of the SOAP call, it will solve the problem.
Try declare the public object Owner as private(e.g: private Object Owner = null;) or to exclude a field using [NonSerialized] attribute. Please refer to the following articles.
wyx2000
Contributor
3388 Points
873 Posts
Is there a way to exclude a field for SOAP call?
Oct 12, 2011 08:38 PM|LINK
I have webservice that returns a list of a object, this object contains a field like below
public Object Owner = null;
When I call the webserice, I get error, but the error gone if I comment out the above code. So I believe it is about serialize of the Owner, I am thinking if I can exclude the Owner from the return of the SOAP call, it will solve the problem.
Any idea how to do that? thanks
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Is there a way to exclude a field for SOAP call?
Oct 14, 2011 01:36 AM|LINK
Hi,
Try declare the public object Owner as private(e.g: private Object Owner = null;) or to exclude a field using [NonSerialized] attribute. Please refer to the following articles.
http://sharpertutorials.com/serialization/
http://www.codeproject.com/KB/XML/Serialization_Samples.aspx
Best regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework