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

Deserializing XML

I am trying to use XmlSerializer to serialize the XML string into an object.
I used the XML schema definition to generate the code for the corresponding class (using xsd.exe).
The top level class has references to objects of other classes that are defined in the same schema.

I am trying to deserialize the XML string into an object of the class that was generated as explained above.
Here is my code:
XML string is in this.textBox1.Text.

private void button1_Click(object sender, System.EventArgs e)
{

string strReqInstance = this.textBox1.Text;
XmlTextReader reqInstanceReader = new XmlTextReader(new StringReader(strReqInstance));
XmlSerializer instSerializer = new XmlSerializer(typeof(request_instance));
request_instance reqInstance;
reqInstance = (request_instance) instSerializer.Deserialize(reqInstanceReader);
}

When this code is run I am getting an exception on XmlSerializer construction line:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
Additional information: File or assembly name a2chdxob.dll, or one of its dependencies, was not found.

If I run the similar code within a web service here is the whole callstack (XML is passed through strReqInstance):

System.IO.FileNotFoundException: File or assembly name yi7sw1kj.dll, or one of its dependencies, was not found.
File name: "yi7sw1kj.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
at System.CodeDom.Compiler.CompilerResults.get_Compil edAssembly()
at System.CodeDom.Compiler.CompilerResults.get_Compil edAssembly()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMap ping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer.GenerateTem pAssembly(XmlTypeMapping xmlTypeMapping)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at ACN_RFDWSI_TemplateInfo.ACN_RFDWSI_TemplateInfo.ge tViews(String def_id, String strReqInstance, String strReqContext) in c:\inetpub\wwwroot\acn_rfdwsi_templateinfo\acn_rfd wsi_templateinfo.asmx.cs:line 70

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\DOCUME~1\SCHUSS~1\ASPNET\LOCALS~1\Temp\yi7sw1kj .dll
LOG: Appbase = file:///c:/inetpub/wwwroot/ACN_RFDWSI_TemplateInfo
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/DOCUME~1/SCHUSS~1/ASPNET/LOCALS~1/Temp/yi7sw1kj.dll.

What could be the reason for this problem?
Thanks a lot
Alex
Nov 12 '05 #1
0 1688

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

Similar topics

1
by: Justin Armstrong | last post by:
I'm having difficulties deserializing some objects. Consider the following example of what I'm trying to do: ---------------------------------------------------------- class Person { string...
1
by: Thomas | last post by:
Hi, I implemented a composite pattern which should be serializable to xml. After spending some time in the newsgroups, i finally managed serializing, even with utf-8 instead of utf-16, which...
4
by: Wayne Wengert | last post by:
Using VB.NET I want to read in an XML file that has an array of objects and then step through the resulting array in code. I build a class to define the structure and I am running code to read in...
2
by: Earl Teigrob | last post by:
I am saving and restoring value types such as Int32, DateTime and Boolean in strings. I was wondering if there is a mechanism build into .NET for serializing and deserializing these to string...
1
by: Bob Rock | last post by:
Hello, always having to validate an XML stream against a XSD may add up an important overhead. My XMLs are usually the result of serializing a class instance and often in my applications what I...
5
by: Daniel Gackle | last post by:
I'm getting a strange ArgumentNullException after deserializing a SortedList. Haven't seen this discussed in the newsgroups, but it looks like a bug - unless I missed something obvious? I've...
6
by: Steve Teeples | last post by:
I use serialization to write class data to a file. During my development of this class I need to add properties or fields on occation. After adding a property, when deserializing the data saved...
0
by: Sivajee Akula | last post by:
Hello All, I am trying to consume a .NET Service from Adobe LiveCycle Workflow. The service deals with complex objects. I am getting the following exception at the time of invocation of the...
1
by: =?Utf-8?B?SmVyZW15X0I=?= | last post by:
I am working on an order entry program and have a question related to deserializing nodes with nested elements. The purchase order contains multiple line items which I select using an...
0
by: ullner | last post by:
I have an XML fil that looks like this: <Environment> <AreaOfInterest> <Name>ScenarioMap</Name> <UpperRight> <GDC> <Latitude>-179</Latitude> ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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,...
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.