473,326 Members | 1,972 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,326 software developers and data experts.

XMLSerializer - Using CollectionBase

I'm using XMLSerializer to serialize a hierarchy of class-based objects to
XML. So far, this is working successfully by employing arrays to handle the
multiplicity of child objects. However, I'm trying to employ the use of
collection classes instead because there are methods I need to implement at
that level. But when I instantiate the XMLSerializer, it gives the error:
There was an error reflecting <Root Type>. If I try using

<XmlArrayAttribute(<child object type>)Public ...

I get the same error.

Is it possible to implement collection classes that the XMLSerializer will
work with, or do I have to stick with arrays? Thanks.
Nov 17 '06 #1
1 1701
"Phil Galey" <pa*****@starcalif.com.nospamwrote in message
news:eK****************@TK2MSFTNGP06.phx.gbl...
I'm using XMLSerializer to serialize a hierarchy of class-based objects to
XML. So far, this is working successfully by employing arrays to handle
the
multiplicity of child objects. However, I'm trying to employ the use of
collection classes instead because there are methods I need to implement
at
that level. But when I instantiate the XMLSerializer, it gives the error:
There was an error reflecting <Root Type>. If I try using
Look closely at the error it's returning you. If you're not displaying the
entire exception, then do so. You need to see the InnerException property.

There are constraints on the collections you can use, but the exception
message will tell you what it wants you to do. I couldn't enumerate them for
you, however, I went through the same process and now use collections all
over the place and serialize them to XML just fine.

John
Nov 18 '06 #2

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

Similar topics

5
by: Stuart Robertson | last post by:
I am trying to find a solution that will allow me to use XmlSerializer to serialize/deserialize a collection of objects where a given object is shared between two or more other objects, and not...
8
by: Harris Boyce | last post by:
Hello, I'm trying to use the FOR XML EXPLICIT clause with SQL Server to deserialize data from my database into a strongly-typed collection object that I will use throughout my application. I...
2
by: eastsh | last post by:
I have been looking into using the MS application block for configuration management, and I am very happy with the options it provides. Since it stores hashtables, I decided that for configuration...
4
by: Andy Neilson | last post by:
I've run across a strange behaviour with XmlSerializer that I'm unable to explain. I came across this while trying to use XmlSerializer to deserialize from a the details of a SoapException. This...
2
by: Kent Boogaart | last post by:
Hello all, I have two simple classes: Item and ItemCollection. Item stores a label for the item and an instance of ItemCollection for all child items. ItemCollection just stores a collection of...
3
by: Loui Mercieca | last post by:
Hi, I have created a class, named FormField , which basically contains two fields, name and value. I have set the tag before the class and the field is set as an XmlAttribute whil the name as...
0
by: Charles Law | last post by:
I use the XMLSerializer to serialise an object called SuperClass, and I get something like this <SuperClass> <Classes> <SomeName xsi:type="MyClass1"> </SomeName> <SomeName...
0
by: Phil Galey | last post by:
I have XMLSerializer successfully serializing a collection class that inherits CollectionBase. My reason for doing it this way instead of using an XMLArrayAttribute is that I need to be able to...
2
by: bmomalley | last post by:
Hi Folks, I need help, because I am just at a loss. I'm not super comfortable with XML, but I'm trying to fight my way through generating an RSS XML file for Google Base, and I'm stuck with a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.