Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. error generating the XML document

error generating the XML document

Scheduled Pinned Locked Moved C#
xmlhelpquestiondatabasealgorithms
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lagumaster
    wrote on last edited by
    #1

    hi everyone, i'm getting this error: "There was an error generating the XML document" when i try to serialize a class. it works for other classes except for classes like these : public class studentList() { public student[] students //has only one member and it is an array of another class } i didn't get much info from stackTrace which says: at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write3_Object(String n, String ns, Object o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write228_studentRegistration(String n, String ns, studentRegistration o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write5_studentBody(String n, String ns, studentBody o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_studentMessage(String n, String ns, studentMessage o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write242_studentMessage(Object o) my question is, is it the class? this is a project at work. i was given these schema files and just generated classes from those schemas to use for the project. i already did searching online and i found one that it says it is a problem on the class. let me know please. i will really appreciate your reply. thanks

    S 1 Reply Last reply
    0
    • L lagumaster

      hi everyone, i'm getting this error: "There was an error generating the XML document" when i try to serialize a class. it works for other classes except for classes like these : public class studentList() { public student[] students //has only one member and it is an array of another class } i didn't get much info from stackTrace which says: at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write3_Object(String n, String ns, Object o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write228_studentRegistration(String n, String ns, studentRegistration o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write5_studentBody(String n, String ns, studentBody o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_studentMessage(String n, String ns, studentMessage o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write242_studentMessage(Object o) my question is, is it the class? this is a project at work. i was given these schema files and just generated classes from those schemas to use for the project. i already did searching online and i found one that it says it is a problem on the class. let me know please. i will really appreciate your reply. thanks

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      Did you look at the InnerException property of the exception thrown? Does it give you any useful clues? Typically, this problem comes when one of the member types are not declared [Serializable].

      Regards Senthil _____________________________ My Blog | My Articles | WinMacro

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups