error generating the XML document
-
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
-
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
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