"Roberto Carriquiry" <al*****@microsoft.com> wrote in news:#j4QCAVIEHA.2596
@TK2MSFTNGP10.phx.gbl:
I am writeing a webService that needs to recieve a CDO.Person object as a
parameter. but when I run it I have a runtime error.
Cannot serialize member CDO.PersonClass.DataSource of type CDO.IDataSource
because it is an interface
I assume that something is wrong with the serialization of this object.
Does anyone have experience in this subject?
The error is caused by the fact that the XmlSerializer can't deal
with Interface typed member variables. A webservice ALWAYS uses
XmlSerializer. You have to build the XML yourself and return that, or, if
CDO.Person is serializable using Soap, serialize it to string via a
MemoryStream and return that string, then on the client, deserialize the
object back from the string received.
Frans.
--
Get LLBLGen Pro, the new O/R mapper for .NET:
http://www.llblgen.com
My .NET Blog:
http://weblogs.asp.net/fbouma
Microsoft C# MVP