Hi am having some problems in XML serialization of XML attributes, following are some details of class file generated from XSD.
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://tempuri.org/UpdatePolicy.xsd")]
public partial class policyClasses {
private policyClassesClass[] classField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("class")]
public policyClassesClass[] #class {
get {
return this.classField;
}
set {
this.classField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://tempuri.org/UpdatePolicy.xsd")]
public partial class policyClassesClass {
private string company_idField;
private string deductable_rateField;
private string max_limitField;
private string class_nameField;
private string class_numberField;
private policyClassesClassCchi_class_number cchi_class_numberField;
private policyClassesClassAction_type action_typeField;
private bool action_typeFieldSpecified;
/// <remarks/>
public string company_id {
get {
return this.company_idField;
}
set {
this.company_idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType="positiveInteger")]
public string deductable_rate {
get {
return this.deductable_rateField;
}
set {
this.deductable_rateField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType="positiveInteger")]
public string max_limit {
get {
return this.max_limitField;
}
set {
this.max_limitField = value;
}
}
/// <remarks/>
public string class_name {
get {
return this.class_nameField;
}
set {
this.class_nameField = value;
}
}
/// <remarks/>
public string class_number {
get {
return this.class_numberField;
}
set {
this.class_numberField = value;
}
}
/// <remarks/>
public policyClassesClassCchi_class_number cchi_class_number {
get {
return this.cchi_class_numberField;
}
set {
this.cchi_class_numberField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public policyClassesClassAction_type action_type {
get {
return this.action_typeField;
}
set {
this.action_typeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool action_typeSpecified {
get {
return this.action_typeFieldSpecified;
}
set {
this.action_typeFieldSpecified = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://tempuri.org/UpdatePolicy.xsd")]
public enum policyClassesClassCchi_class_number {
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("1")]
Item1,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("2")]
Item2,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("3")]
Item3,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("4")]
Item4,
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://tempuri.org/UpdatePolicy.xsd")]
public enum policyClassesClassAction_type {
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("10")]
Item10,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("1")]
Item1,
I managed to generate XML based on this class by serialization, but not having any idea to add the XML attribute to the XML generated, i supposed to get an output as below.
<classes>
<class action_type="10">
<company_id>999</company_id>
<deductable_rate>20</deductable_rate>
<max_limit>800</max_limit>
<class_name>Class A</class_name>
<class_number>1</class_number>
<cchi_class_number>2</cchi_class_number>
</class>
how to add the attribute to the element <class action_type = "10">
from /// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public policyClassesClassAction_type action_type {
get {
return this.action_typeField;
}
set {
this.action_typeField = value;
}
}
Please somebody help me on this to manage my deadlines, also tell me if anything is not clear for the valuable responses
Joe
Notice that the generated class is marked partial.
Add another class right next to the generated one in your project and give it a similar name, such as GeneratedClasses.addon.cs. Add this in your new file:
public partial class policyClasses {
[System.Xml.Serialization.XmlAttribute]
public policyClassesClassAction_type action_type { get;set;}
}
Related
I am getting this error when I run my code
System.InvalidOperationException
HResult=0x80131509
Message=HamiltonXML.Program is inaccessible due to its protection
level. Only public types can be processed.
Source=System.Xmlenter code here
StackTrace:
at System.Xml.Serialization.TypeDesc.CheckSupported()
at System.Xml.Serialization.TypeScope.GetTypeDesc(Type type,
MemberInfo source, Boolean directReference, Boolean throwOnError)
at System.Xml.Serialization.TypeScope.ImportTypeDesc(Type type, MemberInfo memberInfo, Boolean directReference)
at System.Xml.Serialization.TypeScope.GetTypeDesc(Type type, MemberInfo source, Boolean directReference, Boolean throwOnError)
at System.Xml.Serialization.ModelScope.GetTypeModel(Type type, Boolean directReference)
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at HamiltonXML.Program.Main(String[] args) in C:\Users\Aube\source\repos\HamiltonProject\HamiltonProject\Program.cs:line 18
I've changed all classes to public and rechecked all of the code yet the problem still occurs. Here is the code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace HamiltonXML
{
class Program
{
static void Main(string[] args)
{
EnvironmentNodeConfigurationParameters encp = null;
string path = "C:/Users/Aube/Desktop/FreezerEnvironmentNodeParameters_Freezer1.xml";
XmlSerializer serializer = new XmlSerializer(typeof(EnvironmentNodeConfigurationParameters));
StreamReader reader = new StreamReader(path);
encp = (EnvironmentNodeConfigurationParameters)serializer.Deserialize(reader);
reader.Close();
}
// NOTE: Generated code may require at least .NET Framework 4.5 or .NET Core/Standard 2.0.
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class EnvironmentNodeConfigurationParameters
{
private EnvironmentNodeConfigurationParametersComplexNodeConfigurations[] complexDeviceParameterListField;
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("ComplexNodeConfigurations", IsNullable = false)]
public EnvironmentNodeConfigurationParametersComplexNodeConfigurations[] ComplexDeviceParameterList
{
get
{
return this.complexDeviceParameterListField;
}
set
{
this.complexDeviceParameterListField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class EnvironmentNodeConfigurationParametersComplexNodeConfigurations
{
private EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurations[] complexNodeParameterListField;
private string subDeviceIDField;
private string subDeviceNameField;
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("NodeConfigurations", IsNullable = false)]
public EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurations[] ComplexNodeParameterList
{
get
{
return this.complexNodeParameterListField;
}
set
{
this.complexNodeParameterListField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string SubDeviceID
{
get
{
return this.subDeviceIDField;
}
set
{
this.subDeviceIDField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string SubDeviceName
{
get
{
return this.subDeviceNameField;
}
set
{
this.subDeviceNameField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurations
{
private EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurationsEnvironmentLinkParams environmentLinkParamsField;
private byte nodeIDField;
private string nodeNameField;
private string dependNodeNameField;
private string registerTypeField;
private byte startRegField;
private byte numRegsField;
private string nodeTypeField;
private string valueTypeField;
private string environmentLinkTypeField;
private string guidField;
private bool enabledField;
private string unitsField;
private bool monitoredField;
private byte reportItemField;
/// <remarks/>
public EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurationsEnvironmentLinkParams EnvironmentLinkParams
{
get
{
return this.environmentLinkParamsField;
}
set
{
this.environmentLinkParamsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte NodeID
{
get
{
return this.nodeIDField;
}
set
{
this.nodeIDField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string NodeName
{
get
{
return this.nodeNameField;
}
set
{
this.nodeNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string DependNodeName
{
get
{
return this.dependNodeNameField;
}
set
{
this.dependNodeNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string RegisterType
{
get
{
return this.registerTypeField;
}
set
{
this.registerTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte StartReg
{
get
{
return this.startRegField;
}
set
{
this.startRegField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte NumRegs
{
get
{
return this.numRegsField;
}
set
{
this.numRegsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string NodeType
{
get
{
return this.nodeTypeField;
}
set
{
this.nodeTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string ValueType
{
get
{
return this.valueTypeField;
}
set
{
this.valueTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string EnvironmentLinkType
{
get
{
return this.environmentLinkTypeField;
}
set
{
this.environmentLinkTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Guid
{
get
{
return this.guidField;
}
set
{
this.guidField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool Enabled
{
get
{
return this.enabledField;
}
set
{
this.enabledField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Units
{
get
{
return this.unitsField;
}
set
{
this.unitsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool Monitored
{
get
{
return this.monitoredField;
}
set
{
this.monitoredField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte ReportItem
{
get
{
return this.reportItemField;
}
set
{
this.reportItemField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurationsEnvironmentLinkParams
{
private EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurationsEnvironmentLinkParamsKeyValuePair keyValuePairField;
/// <remarks/>
public EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurationsEnvironmentLinkParamsKeyValuePair KeyValuePair
{
get
{
return this.keyValuePairField;
}
set
{
this.keyValuePairField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class EnvironmentNodeConfigurationParametersComplexNodeConfigurationsNodeConfigurationsEnvironmentLinkParamsKeyValuePair
{
private string keyField;
private string valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Key
{
get
{
return this.keyField;
}
set
{
this.keyField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
}
}
The code is supposed to deserialize an XML file.
Have you tried changing your Program class to public?
namespace HamiltonXML
{
public class Program
{
Could somebody help me generate C# class from XSD(sitemap with images)?
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>http://example.com/sample.html</loc>
<image:image>
<image:loc>http://example.com/image.jpg</image:loc>
</image:image>
<image:image>
<image:loc>http://example.com/photo.jpg</image:loc>
</image:image>
</url>
</urlset>
Here is my classes that were generated by xsd.exe tool:
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true,
Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9",
IsNullable = false)]
public partial class urlset
{
private System.Xml.XmlElement[] anyField;
private List<tUrl> urlField;
/// <remarks/>
[System.Xml.Serialization.XmlAnyElementAttribute()]
public System.Xml.XmlElement[] Any
{
get { return this.anyField; }
set { this.anyField = value; }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("url")]
public List<tUrl> url
{
get { return this.urlField; }
set { this.urlField = value; }
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")]
public partial class tUrl
{
private string locField;
private string lastmodField;
private tChangeFreq changefreqField;
private bool changefreqFieldSpecified;
private decimal priorityField;
private bool priorityFieldSpecified;
private System.Xml.XmlElement[] anyField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "anyURI")]
public string loc
{
get { return this.locField; }
set { this.locField = value; }
}
/// <remarks/>
public string lastmod
{
get { return this.lastmodField; }
set { this.lastmodField = value; }
}
/// <remarks/>
public tChangeFreq changefreq
{
get { return this.changefreqField; }
set { this.changefreqField = value; }
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool changefreqSpecified
{
get { return this.changefreqFieldSpecified; }
set { this.changefreqFieldSpecified = value; }
}
/// <remarks/>
public decimal priority
{
get { return this.priorityField; }
set { this.priorityField = value; }
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool prioritySpecified
{
get { return this.priorityFieldSpecified; }
set { this.priorityFieldSpecified = value; }
}
/// <remarks/>
[System.Xml.Serialization.XmlAnyElementAttribute()]
public System.Xml.XmlElement[] Any
{
get { return this.anyField; }
set { this.anyField = value; }
}
[System.Xml.Serialization.XmlElementAttribute(ElementName = "image", Type = typeof(image))]
public List<image> Images { get; set; }
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")]
public enum tChangeFreq
{
/// <remarks/>
always,
/// <remarks/>
hourly,
/// <remarks/>
daily,
/// <remarks/>
weekly,
/// <remarks/>
monthly,
/// <remarks/>
yearly,
/// <remarks/>
never,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true,
Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.google.com/schemas/sitemap-image/1.1",
IsNullable = false)]
public partial class image
{
private string locField;
private string captionField;
private string geo_locationField;
private string titleField;
private string licenseField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(ElementName = "loc", DataType = "anyURI")]
public string loc
{
get { return this.locField; }
set { this.locField = value; }
}
/// <remarks/>
public string caption
{
get { return this.captionField; }
set { this.captionField = value; }
}
/// <remarks/>
public string geo_location
{
get { return this.geo_locationField; }
set { this.geo_locationField = value; }
}
/// <remarks/>
public string title
{
get { return this.titleField; }
set { this.titleField = value; }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "anyURI")]
public string license
{
get { return this.licenseField; }
set { this.licenseField = value; }
}
}
But I have problem with prefix 'image:', I could not sort out how to add this prefix to serialized xml. If I modify Element name by adding semicolon, then it do escape 'image_x003A_image'
I also used the xsd.exe tool and had the same issue. I resolved it as follows:
In the urlset class, add the following [XmlNamespaceDeclarations] property and create a constructor that adds the "image" xml namespace:
[XmlNamespaceDeclarations]
public XmlSerializerNamespaces xmlns = new XmlSerializerNamespaces();
public urlset()
{
xmlns.Add("image", "http://www.google.com/schemas/sitemap-image/1.1");
}
In my case I only needed a single image, so I added the following attribute to my image property in tUrl
[XmlElement(Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
public image image
{
get
{
return this.imageField;
}
set
{
this.imageField = value;
}
}
This then added the "image:" prefix to all my image elements. You should be able to do something similar for you image list to associate it with the namespace you created above.
This post seems a little old, but hope this helps someone experiencing similar headaches trying to utilize the image sitemap schema extension.
I have tried to read XML document and i have found a method of generating XSD file into a C# class.
XML Document :
<?xml version="1.0" standalone="yes"?>
<sdnList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/sdnList.xsd">
<publshInformation>
<Publish_Date>12/15/2011</Publish_Date>
<Record_Count>5052</Record_Count>
</publshInformation>
<sdnEntry>
<uid>11691</uid>
<lastName>SERVICIOS DE CONTROL INTEGRAL DE OBRAS S.L. SIP SUCURSAL CARTAGENA</lastName>
<sdnType>Entity</sdnType>
<programList>
<program>SDNT</program>
</programList>
<idList>
<id>
<uid>6028</uid>
<idType>NIT #</idType>
<idNumber>900106267-0</idNumber>
<idCountry>Colombia</idCountry>
</id>
</idList>
<addressList>
<address>
<uid>17543</uid>
<address1>Carrera 3 No. 8-38</address1>
<city>Cartagena</city>
<country>Colombia</country>
</address>
<address>
<uid>17544</uid>
<address1>Carrera 4 No. 8-41</address1>
<city>Cartagena</city>
<country>Colombia</country>
</address>
</addressList>
</sdnEntry>
<sdnEntry>
<uid>11692</uid>
<lastName>INVERSIONES EL PROGRESO S.A.</lastName>
<sdnType>Entity</sdnType>
<programList>
<program>SDNT</program>
</programList>
<idList>
<id>
<uid>6027</uid>
<idType>NIT #</idType>
<idNumber>806006517-7</idNumber>
<idCountry>Colombia</idCountry>
</id>
</idList>
<akaList>
<aka>
<uid>12373</uid>
<type>a.k.a.</type>
<category>weak</category>
<lastName>I.P. S.A.</lastName>
</aka>
</akaList>
<addressList>
<address>
<uid>17540</uid>
<address1>Carrera 3 No. 8-38 Ofc. 1</address1>
<city>Cartagena</city>
<country>Colombia</country>
</address>
<address>
<uid>17541</uid>
<address1>Carrera 4 No. 8-41</address1>
<city>Cartagena</city>
<country>Colombia</country>
</address>
<address>
<uid>17542</uid>
<address1>Olaya Herrera Carrera 68 No. 32B-45</address1>
<city>Cartagena</city>
<country>Colombia</country>
</address>
</addressList>
</sdnEntry>
Generated C# Class by XSD tool
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.5448
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Xml.Serialization;
//
// This source code was auto-generated by xsd, Version=2.0.50727.42.
//
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://tempuri.org/sdnList.xsd", IsNullable = false)]
public partial class sdnList
{
private sdnListPublshInformation publshInformationField;
private sdnListSdnEntry[] sdnEntryField;
/// <remarks/>
public sdnListPublshInformation publshInformation
{
get
{
return this.publshInformationField;
}
set
{
this.publshInformationField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("sdnEntry")]
public sdnListSdnEntry[] sdnEntry
{
get
{
return this.sdnEntryField;
}
set
{
this.sdnEntryField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListPublshInformation
{
private string publish_DateField;
private int record_CountField;
private bool record_CountFieldSpecified;
/// <remarks/>
public string Publish_Date
{
get
{
return this.publish_DateField;
}
set
{
this.publish_DateField = value;
}
}
/// <remarks/>
public int Record_Count
{
get
{
return this.record_CountField;
}
set
{
this.record_CountField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool Record_CountSpecified
{
get
{
return this.record_CountFieldSpecified;
}
set
{
this.record_CountFieldSpecified = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntry
{
private int uidField;
private string firstNameField;
private string lastNameField;
private string titleField;
private string sdnTypeField;
private string remarksField;
private string[] programListField;
private sdnListSdnEntryID[] idListField;
private sdnListSdnEntryAka[] akaListField;
private sdnListSdnEntryAddress[] addressListField;
private sdnListSdnEntryNationality[] nationalityListField;
private sdnListSdnEntryCitizenship[] citizenshipListField;
private sdnListSdnEntryDateOfBirthItem[] dateOfBirthListField;
private sdnListSdnEntryPlaceOfBirthItem[] placeOfBirthListField;
private sdnListSdnEntryVesselInfo vesselInfoField;
/// <remarks/>
public int uid
{
get
{
return this.uidField;
}
set
{
this.uidField = value;
}
}
/// <remarks/>
public string firstName
{
get
{
return this.firstNameField;
}
set
{
this.firstNameField = value;
}
}
/// <remarks/>
public string lastName
{
get
{
return this.lastNameField;
}
set
{
this.lastNameField = value;
}
}
/// <remarks/>
public string title
{
get
{
return this.titleField;
}
set
{
this.titleField = value;
}
}
/// <remarks/>
public string sdnType
{
get
{
return this.sdnTypeField;
}
set
{
this.sdnTypeField = value;
}
}
/// <remarks/>
public string remarks
{
get
{
return this.remarksField;
}
set
{
this.remarksField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("program", IsNullable = false)]
public string[] programList
{
get
{
return this.programListField;
}
set
{
this.programListField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("id", IsNullable = false)]
public sdnListSdnEntryID[] idList
{
get
{
return this.idListField;
}
set
{
this.idListField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("aka", IsNullable = false)]
public sdnListSdnEntryAka[] akaList
{
get
{
return this.akaListField;
}
set
{
this.akaListField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("address", IsNullable = false)]
public sdnListSdnEntryAddress[] addressList
{
get
{
return this.addressListField;
}
set
{
this.addressListField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("nationality", IsNullable = false)]
public sdnListSdnEntryNationality[] nationalityList
{
get
{
return this.nationalityListField;
}
set
{
this.nationalityListField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("citizenship", IsNullable = false)]
public sdnListSdnEntryCitizenship[] citizenshipList
{
get
{
return this.citizenshipListField;
}
set
{
this.citizenshipListField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("dateOfBirthItem", IsNullable = false)]
public sdnListSdnEntryDateOfBirthItem[] dateOfBirthList
{
get
{
return this.dateOfBirthListField;
}
set
{
this.dateOfBirthListField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("placeOfBirthItem", IsNullable = false)]
public sdnListSdnEntryPlaceOfBirthItem[] placeOfBirthList
{
get
{
return this.placeOfBirthListField;
}
set
{
this.placeOfBirthListField = value;
}
}
/// <remarks/>
public sdnListSdnEntryVesselInfo vesselInfo
{
get
{
return this.vesselInfoField;
}
set
{
this.vesselInfoField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntryID
{
private int uidField;
private string idTypeField;
private string idNidCountryumberField;
private string idCountryField;
private string issueDateField;
private string expirationDateField;
/// <remarks/>
public int uid
{
get
{
return this.uidField;
}
set
{
this.uidField = value;
}
}
/// <remarks/>
public string idType
{
get
{
return this.idTypeField;
}
set
{
this.idTypeField = value;
}
}
/// <remarks/>
public string idNidCountryumber
{
get
{
return this.idNidCountryumberField;
}
set
{
this.idNidCountryumberField = value;
}
}
/// <remarks/>
public string idCountry
{
get
{
return this.idCountryField;
}
set
{
this.idCountryField = value;
}
}
/// <remarks/>
public string issueDate
{
get
{
return this.issueDateField;
}
set
{
this.issueDateField = value;
}
}
/// <remarks/>
public string expirationDate
{
get
{
return this.expirationDateField;
}
set
{
this.expirationDateField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntryAka
{
private int uidField;
private string typeField;
private string categoryField;
private string lastNameField;
private string firstNameField;
/// <remarks/>
public int uid
{
get
{
return this.uidField;
}
set
{
this.uidField = value;
}
}
/// <remarks/>
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
public string category
{
get
{
return this.categoryField;
}
set
{
this.categoryField = value;
}
}
/// <remarks/>
public string lastName
{
get
{
return this.lastNameField;
}
set
{
this.lastNameField = value;
}
}
/// <remarks/>
public string firstName
{
get
{
return this.firstNameField;
}
set
{
this.firstNameField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntryAddress
{
private int uidField;
private string address1Field;
private string address2Field;
private string address3Field;
private string cityField;
private string stateOrProvinceField;
private string postalCodeField;
private string countryField;
/// <remarks/>
public int uid
{
get
{
return this.uidField;
}
set
{
this.uidField = value;
}
}
/// <remarks/>
public string address1
{
get
{
return this.address1Field;
}
set
{
this.address1Field = value;
}
}
/// <remarks/>
public string address2
{
get
{
return this.address2Field;
}
set
{
this.address2Field = value;
}
}
/// <remarks/>
public string address3
{
get
{
return this.address3Field;
}
set
{
this.address3Field = value;
}
}
/// <remarks/>
public string city
{
get
{
return this.cityField;
}
set
{
this.cityField = value;
}
}
/// <remarks/>
public string stateOrProvince
{
get
{
return this.stateOrProvinceField;
}
set
{
this.stateOrProvinceField = value;
}
}
/// <remarks/>
public string postalCode
{
get
{
return this.postalCodeField;
}
set
{
this.postalCodeField = value;
}
}
/// <remarks/>
public string country
{
get
{
return this.countryField;
}
set
{
this.countryField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntryNationality
{
private int uidField;
private string countryField;
private bool mainEntryField;
/// <remarks/>
public int uid
{
get
{
return this.uidField;
}
set
{
this.uidField = value;
}
}
/// <remarks/>
public string country
{
get
{
return this.countryField;
}
set
{
this.countryField = value;
}
}
/// <remarks/>
public bool mainEntry
{
get
{
return this.mainEntryField;
}
set
{
this.mainEntryField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntryCitizenship
{
private int uidField;
private string countryField;
private bool mainEntryField;
/// <remarks/>
public int uid
{
get
{
return this.uidField;
}
set
{
this.uidField = value;
}
}
/// <remarks/>
public string country
{
get
{
return this.countryField;
}
set
{
this.countryField = value;
}
}
/// <remarks/>
public bool mainEntry
{
get
{
return this.mainEntryField;
}
set
{
this.mainEntryField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntryDateOfBirthItem
{
private int uidField;
private string dateOfBirthField;
private bool mainEntryField;
/// <remarks/>
public int uid
{
get
{
return this.uidField;
}
set
{
this.uidField = value;
}
}
/// <remarks/>
public string dateOfBirth
{
get
{
return this.dateOfBirthField;
}
set
{
this.dateOfBirthField = value;
}
}
/// <remarks/>
public bool mainEntry
{
get
{
return this.mainEntryField;
}
set
{
this.mainEntryField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntryPlaceOfBirthItem
{
private int uidField;
private string placeOfBirthField;
private bool mainEntryField;
/// <remarks/>
public int uid
{
get
{
return this.uidField;
}
set
{
this.uidField = value;
}
}
/// <remarks/>
public string placeOfBirth
{
get
{
return this.placeOfBirthField;
}
set
{
this.placeOfBirthField = value;
}
}
/// <remarks/>
public bool mainEntry
{
get
{
return this.mainEntryField;
}
set
{
this.mainEntryField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/sdnList.xsd")]
public partial class sdnListSdnEntryVesselInfo
{
private string callSignField;
private string vesselTypeField;
private string vesselFlagField;
private string vesselOwnerField;
private int tonnageField;
private bool tonnageFieldSpecified;
private int grossRegisteredTonnageField;
private bool grossRegisteredTonnageFieldSpecified;
/// <remarks/>
public string callSign
{
get
{
return this.callSignField;
}
set
{
this.callSignField = value;
}
}
/// <remarks/>
public string vesselType
{
get
{
return this.vesselTypeField;
}
set
{
this.vesselTypeField = value;
}
}
/// <remarks/>
public string vesselFlag
{
get
{
return this.vesselFlagField;
}
set
{
this.vesselFlagField = value;
}
}
/// <remarks/>
public string vesselOwner
{
get
{
return this.vesselOwnerField;
}
set
{
this.vesselOwnerField = value;
}
}
/// <remarks/>
public int tonnage
{
get
{
return this.tonnageField;
}
set
{
this.tonnageField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool tonnageSpecified
{
get
{
return this.tonnageFieldSpecified;
}
set
{
this.tonnageFieldSpecified = value;
}
}
/// <remarks/>
public int grossRegisteredTonnage
{
get
{
return this.grossRegisteredTonnageField;
}
set
{
this.grossRegisteredTonnageField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool grossRegisteredTonnageSpecified
{
get
{
return this.grossRegisteredTonnageFieldSpecified;
}
set
{
this.grossRegisteredTonnageFieldSpecified = value;
}
}
}
My code :
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.IO;
namespace Validus.New.Domain
{
class Testdeserialize
{
public void test()
{
sdnList sdnEntry = null;
string path = "D:/sdn1.xml";
XmlSerializer serializer = new XmlSerializer(typeof(sdnList));
StreamReader reader = new StreamReader(path);
sdnEntry = (sdnList)serializer.Deserialize(reader);
reader.Close();
}
}
}
But it doesn't work.
So how to deserialize this XML Document to C# class object ?
I dont think you have any issues with serializer/deserializer, rather you got problem here:
StreamReader reader = new StreamReader(path);
sdnEntry = (sdnList)serializer.Deserialize(reader);
reader.Close();
Try instead:
using(var fs = File.OpenRead(path))
{
sdnEntry = (sdnList)serializer.Deserialize(reader);
}
I am having a problem with serializing an object in C#. When the application goes to serialize the object, certain fields get serialized but others do not. In the following code:
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class ACORDInsuranceSvcRqHomePolicyQuoteInqRq
{
private string rqUIDField;
private System.DateTime transactionRequestDtField;
private System.DateTime transactionEffectiveDtField;
private string curCdField;
/// <remarks/>
public string RqUID
{
get
{
return this.rqUIDField;
}
set
{
this.rqUIDField = value;
}
}
/// <remarks/>
public string CurCd
{
get
{
return this.curCdField;
}
set
{
this.curCdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnore()]
public System.DateTime TransactionRequestDt
{
get
{
return this.transactionRequestDtField;
}
set
{
this.transactionRequestDtField = value;
}
}
/// <remarks/>
[XmlElement("TransactionRequestDt")]
public string TransactionRequestDtString
{
get
{
return String.Format("{0:yyyy-MM-dd}", this.TransactionRequestDt);
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnore]
public System.DateTime TransactionEffectiveDt
{
get
{
return this.transactionEffectiveDtField;
}
set
{
this.transactionEffectiveDtField = value;
}
}
/// <remarks/>
[XmlElement("TransactionEffectiveDt")]
public string TransactionEffectiveDtString
{
get
{
return String.Format("{0:yyyy-MM-dd}", this.TransactionEffectiveDt);
}
}
}
you can see that the Fields/Accessors RqUID and CurCd get called but TransactionRequestDtString and TransactionEffectiveDtString do not. I need all of these to be serialized. Thanks!
If they need to be xml serialized they need a public get and set.
Try changing your code to this:
[ReadOnly(true)]
[XmlElement("TransactionRequestDt")]
public string TransactionRequestDtString
{
get
{
return String.Format("{0:yyyy-MM-dd}", this.TransactionRequestDt);
}
set{}
}`
The ReadOnly attribute will not let anyone change it.
Possible answer see: Serializing private member data
I was facing the same issue with some properties(which are nullable) , i FIXED it by using : [XmlElement(IsNullable = true)] decorator
public class Person
{
[XmlElement(IsNullable = true)]
public string Name { get; set; }
}
I'm trying to create an XML output file to import into another program. The example XML file I was given looks like this:
<SalesOrder>
<OrderHeader>
<BillTo>
<EntityID>1234</EntityID>
</BillTo>
</OrderHeader>
<LineItemList>
<OrderLineComment>
<LineItemID>1</LineItemID>
</OrderLineComment>
<LineItem>
...
</LineItem>
<LineItem>
...
</LineItem>
<LineItem>
...
</LineItem>
...
</LineItemList>
</SalesOrder>
I have a C# project that is able to output this type of file using an XmlSerializer with the exception of this part:
<LineItemList>
<OrderLineComment>
<LineItemID>1</LineItemID>
</OrderLineComment>
The LineItemList section is simply a list of LineItems, but at the beginning of the LineItemList there is tacked this different element OrderLineComment.
If I represent this as an array of LineItems, then it looks the same except it's missing the OrderLineComment. If I represent this as a new object LineItemList containing an OrderLineComment and an array of LineItems, I get this:
<LineItemList>
<OrderLineComment>
<LineItemID>1</LineItemID>
</OrderLineComment>
<LineItems>
<LineItem>
...
</LineItem>
...
</LineItems>
Which has what I want, except it wraps all the LineItems with the <LineItems> tag, which isn't what I want either.
So what I'm wondering is:
Is there a way to do this via XmlSerializer? If so, how?
If there isn't, and I have to rewrite the code to use something other than XmlSerializer, what would be the best way to do this and why?
Thanks in advance.
You can make a OrderLineComment and LineItem derive from a common base class :
public abstract class LineItemBase
{
...
}
public class LineItem : LineItemBase
{
...
}
public class OrderLineComment : LineItemBase
{
...
}
Then declare the LineItemList property as a collection of LineItemBase objects, and use the XmlArrayItem attribute to specify which types can be included in the collection:
[XmlArrayItem(typeof(LineItem))]
[XmlArrayItem(typeof(OrderLineComment))]
public List<LineItemBase> LineItemList { get; set; }
This should achieve what you want
You can always implement IXmlSerializable interface on your type. It allows serialization of any complexity and it works with XmlSerializer.
Edit:
Here is the example of generated code if you want to achieve it with standard attributes. I created xsd from your xml and generated the code with XSD.exe.
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[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 SalesOrder {
private OrderHeader orderHeaderField;
private LineItemList lineItemListField;
/// <remarks/>
public OrderHeader OrderHeader {
get {
return this.orderHeaderField;
}
set {
this.orderHeaderField = value;
}
}
/// <remarks/>
public LineItemList LineItemList {
get {
return this.lineItemListField;
}
set {
this.lineItemListField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[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 OrderHeader {
private BillTo billToField;
/// <remarks/>
public BillTo BillTo {
get {
return this.billToField;
}
set {
this.billToField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[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 BillTo {
private short entityIDField;
/// <remarks/>
public short EntityID {
get {
return this.entityIDField;
}
set {
this.entityIDField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[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 LineItemList {
private OrderLineComment orderLineCommentField;
private string[] lineItemField;
/// <remarks/>
public OrderLineComment OrderLineComment {
get {
return this.orderLineCommentField;
}
set {
this.orderLineCommentField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("LineItem")]
public string[] LineItem {
get {
return this.lineItemField;
}
set {
this.lineItemField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[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 OrderLineComment {
private sbyte lineItemIDField;
/// <remarks/>
public sbyte LineItemID {
get {
return this.lineItemIDField;
}
set {
this.lineItemIDField = value;
}
}
}