Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3681896
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:44:11+00:00 2026-05-19T03:44:11+00:00

I recently posted a question about a WCF Restful web service that I am

  • 0

I recently posted a question about a WCF Restful web service that I am writing that I need to take an arbirtrary XSD as an input, and to stream an HTML form as the output. After some help from other users, I have gone with the method to use the XSD to dynamically create a C# file from the XSD using the code below,,,

CodeNamespace codeNamespace = new CodeNamespace("generated");
XmlCodeExporter codeExporter = new XmlCodeExporter(codeNamespace);

ArrayList maps = new ArrayList();
foreach (XmlSchemaType schemaType in xsd.SchemaTypes.Values)
{
    maps.Add(schemaImporter.ImportSchemaType(schemaType.QualifiedName));
}

foreach (XmlSchemaElement schemaElement in xsd.Elements.Values)
{
   maps.Add(schemaImporter.ImportTypeMapping(schemaElement.QualifiedName));
}
foreach(XmlTypeMapping map in maps)
{
    codeExporter.ExportTypeMapping(map);
}

CSharpCodeProvider codeProvider = new CSharpCodeProvider();
CodeParser parser = codeProvider.

using(StringWriter w = new StringWriter())
{
     codeProvider.GenerateCodeFromNamespace(codeNamespace, writer, new      CodeGeneratorOptions());
     writer.Write(w.GetStringBuilder().ToString());
}

What this is doing is outputting the code for the C# file that would represent the XSD that was inputted. This is where I have left off. I was informed that I can now use reflection to generate the HTML form from the generated C# code.

I have a couple concerns…one being the generated code contains multiple partial classes. Will this affect using reflection at all? If it wont affect it, then what is the easiest way to take the code that is generated and begin using reflection on that to generate the output i need? I am new to reflection and am not aware of the tools that I have available to me, so please help out in any way possible. Although lengthy, I have included the generated example code from the class that was created. I apologize about the length, but It might help to see everything.

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")] 
[System.SerializableAttribute()] 
[System.Diagnostics.DebuggerStepThroughAttribute()] 
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] 
public partial class Leads { 
    private LeadsLead[] leadField;
    private ulong vidField; 
    private ulong lidField; 
    private ulong aidField; 
    private bool aidFieldSpecified; 
    private string passwordField; 
    [System.Xml.Serialization.XmlElementAttribute("Lead")]
    public LeadsLead[] Lead { get { return this.leadField; } set { this.leadField = value; } }
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public ulong vid { get { return this.vidField; } set { this.vidField = value; } }
    [System.Xml.Serialization.XmlAttributeAttribute()] 
    public ulong lid { get { return this.lidField; } set { this.lidField = value; } } 
    [System.Xml.Serialization.XmlAttributeAttribute()] 
    public ulong aid { get { return this.aidField; } set { this.aidField = value; } } 
    [System.Xml.Serialization.XmlIgnoreAttribute()]
    public bool aidSpecified { get { return this.aidFieldSpecified; } set { this.aidFieldSpecified = value; } } 
    [System.Xml.Serialization.XmlAttributeAttribute()] 
    public string password { get { return this.passwordField; } set { this.passwordField = value; } } } 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")] 
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()] 
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class LeadsLead { 
        private string firstNameField; 
        private string lastNameField; 
        private string addressField; 
        private string cityField; 
        private LeadsLeadState stateField;
        private string zipField; 
        private string emailField; 
        private string primaryPhoneField; 
        private string loanAmountField; 
        private string balanceField; 



[System.Xml.Serialization.XmlIgnoreAttribute()] 
        public bool LoanTypeSpecified { get { return this.loanTypeFieldSpecified; } set { this.loanTypeFieldSpecified = value; } } 
        public string EstimatedValue { get { return this.estimatedValueField; } set { this.estimatedValueField = value; } } 
        public string LenderDate { get { return this.lenderDateField; } set { this.lenderDateField = value; } }
        public string MobilePhone { get { return this.mobilePhoneField; } set { this.mobilePhoneField = value; } } 
        public bool OptOut { get { return this.optOutField; } set { this.optOutField = value; } } 
        [System.Xml.Serialization.XmlIgnoreAttribute()] 
        public bool OptOutSpecified { get { return this.optOutFieldSpecified; } set { this.optOutFieldSpecified = value; } } 
        public string SendComments { get { return this.sendCommentsField; } set { this.sendCommentsField = value; } } 
        public LeadsLeadVendorID VendorID { get { return this.vendorIDField; } set { this.vendorIDField = value; } } 
        [System.Xml.Serialization.XmlIgnoreAttribute()] 
        public bool VendorIDSpecified { get { return this.vendorIDFieldSpecified; } set { this.vendorIDFieldSpecified = value; } } 
        public System.DateTime CallTime { get { return this.callTimeField; } set { this.callTimeField = value; } } 
        [System.Xml.Serialization.XmlIgnoreAttribute()] 
        public bool CallTimeSpecified { get { return this.callTimeFieldSpecified; } set { this.callTimeFieldSpecified = value; } } 
        public string AdSource { get { return this.adSourceField; } set { this.adSourceField = value; } } 
        public LeadsLeadResult Result { get { return this.resultField; } set { this.resultField = value; } } 
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool ResultSpecified { get { return this.resultFieldSpecified; } set { this.resultFieldSpecified = value; } } 
        public decimal Duration { get { return this.durationField; } set { this.durationField = value; } } 
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool DurationSpecified { get { return this.durationFieldSpecified; } set { this.durationFieldSpecified = value; } } 
        public string ReviewStatus { get { return this.reviewStatusField; } set { this.reviewStatusField = value; } } 
        public string SubID { get { return this.subIDField; } set { this.subIDField = value; } } 
        public string Borrowers { get { return this.borrowersField; } set { this.borrowersField = value; } } 
        public string Loans { get { return this.loansField; } set { this.loansField = value; } } 
        [System.Xml.Serialization.XmlArrayItemAttribute("Driver", IsNullable=false)] 


public partial class LeadsLeadDriver { 
                private string firstNameField; 
            private string lastNameField;  
            public string FirstName { get { return this.firstNameField; } set { this.firstNameField = value; } }  
            public string LastName { get { return this.lastNameField; } set { this.lastNameField = value; } } }  
        [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")] 
        [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] 
        public enum LeadsLeadStandardState {  AL,  AK,  AZ,  AR,  CA,  CO,  CT,  DE,  DC,  FL,  GA,  HI,  ID,  IL,  IN,  IA,  KS,  KY,  LA,  ME,  MD,  MA,  MI,  MN,  MS,  MO,  MT,  NE,  NV,  NH,  NJ,  NM,  NY,  NC,  ND,  OH,  OK,  OR,  PA,  RI,  SC,  SD,  TN,  TX,  UT,  VT,  VA,  WA,  WV,  WI,  WY,  PR,  NS,  Alabama,  Alaska,  Arizona,  Arkansas,  California,  Colorado,  Connecticut,  Delaware,  [System.Xml.Serialization.XmlEnumAttribute("District of Columbia")] DistrictofColumbia,  Florida,  Georgia,  Hawaii,  Idaho,  Illinois,  Indiana,  Iowa,  Kansas,  Kentucky,  Louisiana,  Maine,  Maryland,  Massachusetts,  Michigan,  Minnesota,  Mississippi,  Missouri,  Montana,  Nebraska,  Nevada,  [System.Xml.Serialization.XmlEnumAttribute("New Hampshire")] NewHampshire,  [System.Xml.Serialization.XmlEnumAttribute("New Jersey")] NewJersey,  [System.Xml.Serialization.XmlEnumAttribute("New Mexico")] NewMexico,  [System.Xml.Serialization.XmlEnumAttribute("New York")] NewYork,  [System.Xml.Serialization.XmlEnumAttribute("North Carolina")] NorthCarolina,  [System.Xml.Serialization.XmlEnumAttribute("North Dakota")] NorthDakota,  Ohio,  Oklahoma,  Oregon,  Pennsylvania,  [System.Xml.Serialization.XmlEnumAttribute("Rhode Island")] RhodeIsland,  [System.Xml.Serialization.XmlEnumAttribute("South Carolina")] SouthCarolina,  [System.Xml.Serialization.XmlEnumAttribute("South Dakota")] SouthDakota,  Tennessee,  Texas,  Utah,  Vermont,  Virginia,  Washington,  [System.Xml.Serialization.XmlEnumAttribute("West Virginia")] WestVirginia,  Wisconsin,  Wyoming,  [System.Xml.Serialization.XmlEnumAttribute("Puerto Rico")] PuertoRico,  [System.Xml.Serialization.XmlEnumAttribute("No State")] NoState, } 
        [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")] 
        [System.SerializableAttribute()] 
        [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] 
        public enum LeadsLeadStatus {  Pending,  Working,  Closed,  Dead, } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:44:11+00:00Added an answer on May 19, 2026 at 3:44 am

    I have a couple concerns…one being the generated code contains multiple partial classes. Will this affect using reflection at all?

    I see one question in all of your text, and this is it. The answer is no, that a class is defined in source as partial does not impact reflection at all. partial is merely a source code “trick”, if you will, that allows you to split the definition of a class or method across multiple source files. The compiler combines these multiple definitions into one class or method at the end and reflection can’t see and is not impacted by that fact.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently posted this question about codes for a gift-card-like voucher that users can
I recently posted a question about screen rotation in my live wallpaper. To test
I recently posted a question about centering a page with CSS. I figured out
I recently posted a question about getting a NullPointerException whenever I called an array
From another question I recently posted, it seems that Classic ASP might not be
I recently posted a question about getting last 3 results in table in the
I recently posted a question about optimizing the algorithm to compute the Levenshtein Distance,
Recently i posted a question about what the variable is of a file which
I recently posted a question here about some memory issues I was having. I've
Relatively new to python. I recently posted a question in regards to validating that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.