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

Deserialize xml to object.

bhu
I have a xml which is like this.
now if i remove the iu part from the xml then i am able to deserialize but i
don't want to do it,
any idea how to do it ?

XML:
<iu:InventoryUpdateBatch
xmlns:iu="http://www.abc.com/schema/InventoryUpdate"
xmlns:th="http://www.abc.com/schema/TransactionHeader"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InventoryUpdate>
<TransactionHeader</TransactionHeader>
</InventoryUpdate>
</iu:InventoryUpdateBatch>

Code:
public class InventoryUpdateBatch
{
[System.Xml.Serialization.XmlElementAttribute("Inve ntoryUpdate")]
public InventoryUpdate[] InventoryUpdatetype;
}

InventoryUpdateBatch invtype = new InventoryUpdateBatch();
System.Xml.Serialization.XmlSerializer serializer = new
System.Xml.Serialization.XmlSerializer(invtype.Get Type());
System.IO.StreamReader w = new StreamReader(@"C:\b.xml");
invtype = (InventoryUpdateBatch)serializer.Deserialize(w);

thanks
bhu

Aug 31 '06 #1
0 2723

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

Similar topics

1
by: Carl Mercier | last post by:
Hi! I have 2 different applications/assembly. The first one creates an object and serializes it to a textfile on disk. The second one has the the exact same class (copied/pasted). It reads...
7
by: Ian Tompsett | last post by:
H I was wondering if it possible for an object to serialize/deserialize itself from XML. I'd be guessing that it would need to use the XmlSerializer class, but that seems to want to create a...
1
by: Alex | last post by:
I am creating an application that allows the user to link a plug-in "utility" class (Watcher) to a class at runtime. There are several Watcher utilities, each with a different style of "watching"...
2
by: PCH | last post by:
I have 2 functions, one to serialize an object, and one to deserialize it. I can serialize just fine, the problem is when I try to deserialize it later... I get an error: {"Invalid...
0
by: Fruber Malcome | last post by:
I'm getting a very weird exception and hoping someone may be able to help. I have an Office Add-In that lives in a .dll (for email reference ai.dll) ai.dll makes calls into the core part of the...
4
by: George Addison | last post by:
I understand this might not be the optimal method of deserialization, but how can I deserialize a class to itself? Something like: Public Sub New(Optional ByVal filename as string = Nothing)...
0
by: Matt S | last post by:
Hello, I'm trying to build a C# client to consume an AXIS Web Service (running SOAP over HTTP). The Web Service encodes full server-side exception traces in the Soap Fault > Detail element...
3
by: Jeff Richardson | last post by:
This is a repost from the InfoPath news group. Hi, I am writing a SharePoint application that works with InfoPath forms. When a user submits a completed InfoPath form to a forms library my code...
2
by: Thomas S | last post by:
Any suggestions on how to deserialize an object from one line of XML? I'm trying to deserialize multiple objects from one XML document, each object on one line of the file. The serialization is...
0
by: connectpalm03-forum | last post by:
I have a class named (MyClassA) in ControlClasses.dll and was able to serialize it to database. Like below SaveTo(MemoryStream stream) { IFormatter formatter = new BinaryFormatter(); ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.