473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Serialize Person Object

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?

thanks
Rob.-
Nov 16 '05 #1
1 2074
"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
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Sleeman | last post by:
Hi all, i just spent an hour rifling through code to find the cause of a problem only to find it's an oddity with serialization and recursive objects, so figured I'd post for the next person who...
1
by: Iyer, Prasad C | last post by:
Hi, I got a class which I need to serialize, except for couple of variable. i.e. import cPickle as p class Color: def __init__(self): print "hello world" self.x=10 self.somechar="this are...
3
by: Kristian Kjems | last post by:
This is the example from MSDN where an object is serialized to a filestream: MySerializableClass myObject = new MySerializableClass(); // Insert code to set properties and fields of the object....
5
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
5
by: Arjen | last post by:
Hello, I have an array "aPeople" with people objects which I serialize like this: XmlSerializer x = new XmlSerializer( typeof(People) ); TextWriter writer = new StreamWriter( "data.xml" );...
0
by: Arjen | last post by:
Hello, I have made a little test application and needs some help. I have two classes with hash tables which I want to serialize inside one xml file. My question is if someone can make the...
1
by: Roberto Carriquiry | last post by:
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...
4
by: surindersaini | last post by:
Hi I am not sure if we can do it and if can, then how. I have a class with a property that return object as its return type. when i am trying to Serialize the class it gives me error ...
6
by: Demetri | last post by:
I have a class that I need to serialize. For example if I had a Person class with the properties of FirstName and LastName. Currently when I serialize the class it looks like this: <?xml...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.