473,509 Members | 3,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML Serializer question...

Hi,

I have an array of structures I would like to turn into
an XML string using the XML serializer. The problem I am
running into is that I get an exception. Depending on
what data type I set the serializer up with (my structure
or ArrayList), I get either "Invalid Cast" or "...did not
expect type <my structure> ..."

Does anybody know how I can do this WITHOUT having to
resort to using the SOAP formatter? It seems like a waste
to put all of that extra stuff in my xml.

Thanks,
James

Nov 11 '05 #1
1 1323
can you show us a simple test case that illustrates the problem you are
encountering?

Show us the code that does the serialization.

-Dino

"James" <ja*****@hds-pams.com> wrote in message
news:0c****************************@phx.gbl...
Hi,

I have an array of structures I would like to turn into
an XML string using the XML serializer. The problem I am
running into is that I get an exception. Depending on
what data type I set the serializer up with (my structure
or ArrayList), I get either "Invalid Cast" or "...did not
expect type <my structure> ..."

Does anybody know how I can do this WITHOUT having to
resort to using the SOAP formatter? It seems like a waste
to put all of that extra stuff in my xml.

Thanks,
James

Nov 11 '05 #2

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

Similar topics

1
1248
by: | last post by:
Hi, When we get generic collections will the serializer change so we dont need to give it a type parameter for collections ? Currently today if we serialize an ArrayList, we have to give it a...
0
1466
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
1
1527
by: Marty McDonald | last post by:
I created business entity classes using XSD.exe. In code I've populated my dataset. Now, I want to put that data into the entity class. Do I use DataSet.WriteXml() to a memorystream, then pass...
3
2096
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
0
978
by: Albert Jan | last post by:
Hi, I use the XmlSerializer in C# to serialize an object containing an email message to xml. This works often fine, but for some mailmessages the serialization fails with the message 'There was...
6
1732
by: Dave Veeneman | last post by:
Is XML Serialization worth using to persist classes to file? I've been trying for a day to get it to work on some fairly simple classes. what I'm getting back are error messages like "There is an...
6
4648
by: Wilfried Mestdagh | last post by:
Hi, I use this class to save application settings in a xml file. Sometime I have exception error in the Load method, and sometime in the Save method. Is this a bug in NET or is there something I...
8
4266
by: Q. John Chen | last post by:
I have following code: public class Member { public string FirstName; public string LastName; public string GetXml() { StringBuilder sb = new StringBuilder(); XmlSerializer serializer
1
1656
by: hawkeye.parker | last post by:
using .net 1.1 i think i might want to replace the xml serializer which my .Net webservice uses with a custom serializer. anyone know: a) is this possible? b) if so, is it terribly difficult...
0
7234
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
7136
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
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
441
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.