More than likely it's erroring out inside of the xsd.exe internals, based on the input being passed in as well as schema's linked together.
I wouldn't use xsd.exe to generate your objects, in theory it works with most, but not the broadworks schema's.
The way I got around this was using the Microsoft.Xml.XMLGen that comes from the XmlGenerator.dll. You can find more information about it here http://www.codeproject.com/KB/XML/CustomSerializationPart3.aspx. Here is the MSDN article to download the library from http://msdn.microsoft.com/en-us/library/aa302296.aspx.
It's pretty straight forward, let me know if you have any issues and I can help out.
Posted: Jul 24, 2009Thank you, I posted a ? up on msdn forums as well to see if anyone over there could shed anylight on the problems. It looks to me like the part xsd.exe choked on was the OCITable element. It generated that section totally wrong.
As far as your method, I believe thats workable and very similar to working with NHIbernate. If i understand you correctly you used the XmlGen tool to generate xml files from the OCI Schemas, then manually coded the Object and a mapping file. Then made a custom serialization similar to the example in the linked codeproject article?
Posted: Jul 24, 2009Close. I actually just generate the XML at runtime and then serialize and deserialize. This saves me the trouble of having to access the filesystem by creating xml files. So basically all that is necessary is to map the schema files in a local directory from you web app. Then you can generate it on the fly.
Let me know if you have anymore questions.
Posted: Jul 27, 2009
FWIW, I have I think mostly successfully done this.
After using xsd.exe to produce the C# serialisation, I modified the generated code to properly deal with the jagged arrays that are returned in OCITable. You'll see commentary in various places about xsd.exe's inability to deal with jagged arrays.
--- OCISchemaAS_OCISchemaBASE.cs   2009-12-10 18:45:56.000000000 +1100
+++ OCISchemaAS_OCISchemaBASE.cs.modified   2009-12-10 17:49:05.000000000 +1100
@@ -8095,7 +8095,7 @@
       Â
        private string[] colHeadingField;
       Â
-Â Â Â Â Â Â Â private OCITableRow[] rowField;
+Â Â Â Â Â Â Â private string[][] rowField;
       Â
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("colHeading", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
@@ -8107,48 +8107,19 @@
                this.colHeadingField = value;
            }
        }
-
+Â Â Â Â Â Â Â
        /// <remarks/>
-Â Â Â Â Â Â Â [System.Xml.Serialization.XmlElementAttribute("row", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
-Â Â Â Â Â Â Â public OCITableRow[] row
-Â Â Â Â Â Â Â {
-Â Â Â Â Â Â Â Â Â Â Â get
-Â Â Â Â Â Â Â Â Â Â Â {
+Â Â Â Â Â Â Â [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
+Â Â Â Â Â Â Â [System.Xml.Serialization.XmlArrayItemAttribute("col", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
+Â Â Â Â Â Â Â public string[][] row {
+Â Â Â Â Â Â Â Â Â Â Â get {
                return this.rowField;
            }
-Â Â Â Â Â Â Â Â Â Â Â set
-Â Â Â Â Â Â Â Â Â Â Â {
+Â Â Â Â Â Â Â Â Â Â Â set {
                this.rowField = value;
            }
        }
    }
-
-Â Â Â /// <remarks/>
-
-Â Â Â /// <remarks>Created by hand to work around xsd.exe trying to serialize jagged arrays</remarks>
-Â Â Â [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
-Â Â Â [System.SerializableAttribute()]
-Â Â Â [System.Diagnostics.DebuggerStepThroughAttribute()]
-Â Â Â [System.ComponentModel.DesignerCategoryAttribute("code")]
-Â Â Â [System.Xml.Serialization.XmlTypeAttribute(Namespace="C")]
-Â Â Â public partial class OCITableRow {
-Â Â Â Â Â Â Â
-Â Â Â Â Â Â Â private string[] colField;
-
-Â Â Â Â Â Â Â /// <remarks/>
-Â Â Â Â Â Â Â [System.Xml.Serialization.XmlElementAttribute("col", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
-Â Â Â Â Â Â Â public string[] col
-Â Â Â Â Â Â Â {
-Â Â Â Â Â Â Â Â Â Â Â get
-Â Â Â Â Â Â Â Â Â Â Â {
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return this.colField;
-Â Â Â Â Â Â Â Â Â Â Â }
-Â Â Â Â Â Â Â Â Â Â Â set
-Â Â Â Â Â Â Â Â Â Â Â {
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â this.colField = value;
-Â Â Â Â Â Â Â Â Â Â Â }
-Â Â Â Â Â Â Â }
-Â Â Â }
   Â
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
I've actually not used the resulting OCITable construct yet though, just a number of the other transactions (creating users, assigning services etc), so it scarcely qualifies as tested.
Posted: Jan 22, 2010