When serializing an object with tested code I get the error "There was en error generating the XML document."

I have a problem serializing an object with the XmlSerializer.Serialize method. We created a .Net application that would process information both from on-line input and input from an external system (batch processing)  and store the information in an SQL Server 2005 database. Another batch would process the information, setting it into an object collection that would later be serialized to an xml file with ISO-8859-1 encoding that would be sent to another application that would create reports from it. It's all fairly straight forward, nothing really exotic. In the testing phase everything seems to work just fine. Then we progress to the production acceptance test where production data is used where especially the input from external systems contains all sorts of dubious characters like ñ, ©, «, /, ¬, en ë. All of the sudden we get the error "There was en error generating the XML document.". I scanned all of the table fields (strings) that could have caused such a problem and tested the characters, nothing. Everything serializes fine, not always what you would want, but it serializes without raising any errors. And we're only talking about a collection of about a thousand objects, absolutely nothing for the capacity of our production test environment. It's like trying to find a needle in a hay stack, the error doesn't help you at all.

Does anyone have any wisdom on this subject...some agonizingly painful and frustrating experiences they would like to share?

 

0
BarryC
5/29/2008 10:04:35 PM
asp.net.xml-datasource 7181 articles. 0 followers. Follow

1 Replies
907 Views

Similar Articles

[PageSpeed] 38

Found the problem. We weren't logging the inner exception of uncaught exceptions and that's where the information was that we needed.

It seems that unicode character 2013 (endash) was causing our problem. When the users would enter space-dash-space the dash would be converted to the u2013 character (by the keyboard?). It took us some time to figure out what character u2013 looked like so that we could scan our database for it. A nice method for doing that is in Word, choose Insert in the menu and click on Symbol. At the bottom of the pop-up there's a textbox, "Character code" and a drop-down "from:". Fill the first one in with "2013" and set the second one to "Unicode (hex)". Voila, the character gets highlighted. Add it to your document, cut and paste it into an SQL query, execute it and the culprits are found. You learn something new everyday.

0
BarryC
6/13/2008 1:30:27 PM
Reply:

Similar Artilces:

"There was an error generating the XML document" error
Using PB10.5.2 Build 7016 Generated proxies for Web Service using .NET (not EasySoap) Most functions work, but getting this error when calling a particular function whose 1st parameter is a complex datatype (which PB converts to structure) consisting of other complex data types (which PB converts to structures). The function is: SetTerminalsApplicationCharacteristics ( ggws_fwMTSetAppCharacteristics AppCharacteristics, string terminals[] ) returns ggws_sendmessageresponses ggws_fwMTSetAppCharacteristics has 17 fields that are structures. Each of these structures has 2-5 fields ...

When I get .XML document with Request.Form["xml"].ToString(); it gets error.
XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(Request.Form["xml"].ToString());  I want system doesn't interrupt the code execution. How can I do system doesn't give error message?  Thanks.  Error Message  A potentially dangerous Request.Form value was detected from the client (xml="...8859-9" ?><BORCELIK><Tarih>09/...").  ...

Exception ( "There was an error generating XML document" )
I have a web method which has the following signature public webmethod( impFile obj1,System.Object obj2,int obj3); I call this method from the client of the web sevice passing it the following parameters. impFile obj1 = new impFile(); FileDownloadInfo obj2 = new FileDownloadInfo(); int obj3 = 3; someobject.webmethod( obj1,obj2,obj3); this method calls throws System.InvalidOperationException and the message is "There was an error generating XML Document". The proxy class generated for the web service on the client side contains the definition of the...

superreview requested: [Bug 251274] Error: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "chrome://inspector/content/inspector.xml Line:
Boris Zbarsky <bzbarsky@mit.edu> has asked neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> for superreview: Bug 251274: Error: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "chrome://inspector/content/inspector.xml Line: 684"] https://bugzilla.mozilla.org/show_bug.cgi?id=251274 Attachment 193251: Fix https://bugzilla.mozilla.org/attachment.cgi?id=193251&action=edit ------- Additional Comments from Boris Zbarsky <bzbarsky@mit.edu> This just makes su...

superreview granted: [Bug 251274] [FIX]Error: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "chrome://inspector/content/inspector.xml Lin
neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> has granted Boris Zbarsky <bzbarsky@mit.edu>'s request for superreview: Bug 251274: [FIX]Error: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "chrome://inspector/content/inspector.xml Line: 684"] https://bugzilla.mozilla.org/show_bug.cgi?id=251274 Attachment 193251: Fix https://bugzilla.mozilla.org/attachment.cgi?id=193251&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil.parkwa...

Getting "XML Parsing Error: no element found" even when no code is in form!
I published a default.aspx webform to IIS 6 and got the great error message:XML Parsing Error: no element foundLocation: http://Courses/test/survey.aspxLine Number 1, Column 1: I have no extra code in this page, it's just the page that visual studio 2008 creates when starting a new web application project. It's worked fine forever. The only "change" that's happened on the server was a software installation of the Oracle Database 11g Release 1 Client and Oracle Developer Tools for Visual Studio. I also had the server admin set some environment variables.  Has a...

"Error Group: WINSOCK" "Error Code:11004"
Hi Just setup iPrint on the server and tried to install the printer to the laptop and got the following message: Error code:11004 Error message: Winsock 11004 - The DNS name has been found in the database, but its associated data is not correct. Error group: WINSOCK Error code:11004 Anyone know what associated data it is referring to? Thanks in advance -- iangh2 A quick Google found this on http://www.sockets.com/err_lst1.htm WSANO_DATA (11004) Valid name, no data record of requested type Berkeley description: The requested name is valid, but does not hav...

superreview granted: [Bug 428847] XML Parsing Error with ":" in href attribute of xml-stylesheet processing instruction : [Attachment 316114] Fix, with tests.
Jonas Sicking (:sicking) <jonas@sicking.cc> has granted Johnny Stenback (:jst) <jst@mozilla.org>'s request for superreview: Bug 428847: XML Parsing Error with ":" in href attribute of xml-stylesheet processing instruction https://bugzilla.mozilla.org/show_bug.cgi?id=428847 Attachment 316114: Fix, with tests. https://bugzilla.mozilla.org/attachment.cgi?id=316114&action=edit ...

superreview requested: [Bug 428847] XML Parsing Error with ":" in href attribute of xml-stylesheet processing instruction : [Attachment 316114] Fix, with tests.
Johnny Stenback (:jst) <jst@mozilla.org> has asked Jonas Sicking (:sicking) <jonas@sicking.cc> for superreview: Bug 428847: XML Parsing Error with ":" in href attribute of xml-stylesheet processing instruction https://bugzilla.mozilla.org/show_bug.cgi?id=428847 Attachment 316114: Fix, with tests. https://bugzilla.mozilla.org/attachment.cgi?id=316114&action=edit ...

error while appending the xml document "The Node to be inserted is from a diffrent document context."
Hi all I am trying to appened an xml file (JobComplete.xml) with the xml node i got as a paramater (xmlNode) the xml structure is like xmlNode:- <buzzsawJobs> <buzzsawJob> <jobId>1</jobId> </buzzsawJob> </buzzsawJobs> JobComplete.xml <buzzsawJobs> <buzzsawJob> <jobId>1</jobId> <jobId>2</jobId> <jobId>3</jobId> </buzzsawJob> </buzzsawJobs> The error i get is "The Node to be inserted is from a diffrent document context...

datawindow.import(XML!,"file.xml") syntax error
I am using Pocket PowerBuilder 1.5 build 360 from the help file I saw [ImportFile method (DataWindows)] long dwcontrol.ImportFile ( {saveastype importtype}, string filename {, long startrow {, long endrow {, long startcolumn {, long endcolumn {, long dwstartcolumn } } } } } ) This statement inserts all the data in the file D:\TMP\EMPLOYEE.CSV into dw_employee starting at the first column: dw_employee.ImportFile("D:\TMP\EMPLOYEE.CSV") This statement inserts all the data in the file D:\TMP\EMPLOYEE.XML into dw_employee starting at the first column: dw_em...

"Error loading XML file :\windows\microsoft.net\framework\v1.0.3705"...does this mean v.1.1 code trying to run in a v.1.0 app?
I uploaded some new files into my existing third-party hosted site, including a .DLL into \BIN\, which is running AS.NET v.1.0. I got the following error message when browsing to one of the pages using the code in the namespace defined in the DLL: Error loading XML file c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. (c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config) ...

How can I solve this error "XML Parsing Error: no element found"
 heres my code behind in UploadImage.aspx.vb _____________________________________________________________________________________________________________________________Imports System.Data.SqlClientImports System.ConfigurationImports System.IOPartial Class UploadImage    Inherits System.Web.UI.Page    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click        Dim conn As New SqlConnection        Dim comm As New SqlCommand  ...

Getting compilation error "The compiler failed with error code 128"
Hi All - I am getting a compilation error when I contact AXMS page , below is the error which i got . Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: The compiler failed with error code 128. when i retstart the system its working fine , but its happening now and then so could not able to predict whats going on .  kindly guide me to eluminate this problem .  Thanks, Jeyaprakash. Tr...

Web resources about - When serializing an object with tested code I get the error "There was en error generating the XML document." - asp.net.xml-datasource

Serializing Dickens to LEDs
[ch00f] managed to capture some holiday spirit this year by translating all of A Christmas Carol to scrolling text. Dickens’s work has long since ...

Twitter Blog
Twitter is a place for telling stories Friday, May 25, 2012 In the little bit of spare time I have outside of Twitter I like to write fiction. ...

Twitter is a place for telling stories
... how it ends. So I’m especially excited about Jennifer Egan’s new short story “Black Box”, which the New Yorker fiction department is serializing ...

Twitter Engineering: A Storm is coming: more details and plans for release
Thursday, August 4, 2011 A Storm is coming: more details and plans for release We've received a lot of questions about what's going to happen ...

Document Object Model - Wikipedia, the free encyclopedia
JavaScript was released by Netscape Communications in 1996 within Netscape Navigator 2.0. Netscape's competitor, Microsoft , released Internet ...

abiword-dev Mailing List Archive: Re: Will OASIS/XML format be supported?
> I am writing an article about the standard XML > format for office > documents being developed by the OASIS consortium. I > haven't been ...

Applicatives and a story of composability with sjsonapp
... } } Accumulating Validation Errors Here's a test snippet that demonstrates how you can get back validation errors in a List when de-serializing ...

Bullett Media
Bullett Media

Apache Flume Development Status Update
Cloudera offers enterprises a powerful new data platform built on the popular Apache Hadoop open-source software package.

Google debuts Dart, a JavaScript alternative
Net giant details a new programming language for Web apps big and small, but stops well short of a 2010 internal memo that said it's designed ...

Resources last updated: 12/1/2015 9:40:33 AM