473,404 Members | 2,137 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,404 software developers and data experts.

Deserialization question

I have a simple question. I am using the XSD.exe to
generate my C# classes. When I go to deserialize I do this:
( where qcmoverini is the root XML element ).

<qcmoverini>
<paths
transactionpath="c:\movertest\qctransactionlog.xml "
statuspath="c:\movertest\qcstatus.xml"
destpath="c:\movertest\data\"/>
<intervals filecontention="4" waitcycle="15"/>
</qcmoverini>

But if I try to reach directly into an internal class I
always error. like my class paths. It shows up on
intellisense as if it should work.
try
{
TextReader reader = new StreamReader(fiPath);
XmlSerializer serializer = new XmlSerializer(typeof
(qcInit.qcmoverini));
qcInit.qcmoverini allIni= (qcInit.qcmoverini)
serializer.Deserialize(reader);
// now try to reach in directly with new reader
XmlSerializer serializerpaths = new XmlSerializer(typeof
(qcInit.paths));
qcInit.paths iniPaths = (qcInit.paths)
serializerpaths.Deserialize(reader);

QUESTION. Is there a way to reach in directly and if do
how? Thanks
Nov 11 '05 #1
1 1389
I think this was answered already, somewhere else?
What you need to do is position the stream properly.

"andrewcw" <an************@boeing.com> wrote in message
news:79****************************@phx.gbl...
I have a simple question. I am using the XSD.exe to
generate my C# classes. When I go to deserialize I do this:
( where qcmoverini is the root XML element ).

<qcmoverini>
<paths
transactionpath="c:\movertest\qctransactionlog.xml "
statuspath="c:\movertest\qcstatus.xml"
destpath="c:\movertest\data\"/>
<intervals filecontention="4" waitcycle="15"/>
</qcmoverini>

But if I try to reach directly into an internal class I
always error. like my class paths. It shows up on
intellisense as if it should work.
try
{
TextReader reader = new StreamReader(fiPath);
XmlSerializer serializer = new XmlSerializer(typeof
(qcInit.qcmoverini));
qcInit.qcmoverini allIni= (qcInit.qcmoverini)
serializer.Deserialize(reader);
// now try to reach in directly with new reader
XmlSerializer serializerpaths = new XmlSerializer(typeof
(qcInit.paths));
qcInit.paths iniPaths = (qcInit.paths)
serializerpaths.Deserialize(reader);

QUESTION. Is there a way to reach in directly and if do
how? Thanks

Nov 11 '05 #2

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

Similar topics

2
by: Meta-Meta | last post by:
Hi, I'm trying to deserialize a VC++ .NET class and am stumped by the following problem : In order to create the XmlSerializer you need to pass the type of the object being created. The doc...
2
by: Snowman | last post by:
Suppose I have a RootObject which holds a collection of other objects. The other objects have a property (Parent) which refers back to the "parent" collection (b.t.w. my collection is based on...
3
by: AnkitAsDeveloper [Ankit] | last post by:
Hi i am serializing a 'ref struct' object as follows : private: void Seri( String ^path, Object^ obj ) { FileStream^ fileStrm ; try { //Serialize entire object into Binary stream
2
by: andreas | last post by:
Hi, if have a object arrSdList of type SortedList for serialization and deserialization there are two subs for doing this Public Sub deser Dim Formatter As BinaryFormatter = New...
3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
1
by: parrot toes | last post by:
I tried to post this question before, but there was an error when posting. I case it did get posted and in order to avoid duplication, I'll just repost a summary. I have written a dotnet client...
8
by: ashoksrini | last post by:
Hi All, I have the below requirement and would like to get some feeback from the group on the best way to implement: 1. I have WSDL defined exposing few web services. 2. We dont have a...
6
by: Marcus | last post by:
I have a couple of classes looking like this: ======================================== public class AdminSettingsData { public string adminSettingsPath; public string adminSettingsFile;...
1
by: Gregor D. | last post by:
Hi, I want to consume an Apache Webservice with a C# .NET Client. Everything works fine, but I'm having problem with the deserialization of the complex type "Item" that is included in the...
0
by: Gary James | last post by:
I have a question about the methodology used to Serialize / Deserialize objects using XML in .Net 2005 using the v2.0 framework. Say, for example my application creates an instance of Object A,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...

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.