Click here to Skip to main content
12,299,086 members (48,595 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# WCF
[DataContract]
    public class RS_PkgAvail_Category
    {
        /// <remarks/>
        [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "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 PI_TourAvailRS
        {
 
            private string successField;
 
            private PI_TourAvailRSToursTour[][] toursField;
 
            private string primaryLangIDField;
 
            private string requestedCurrencyField;
 
            private string targetField;
 
            private string versionField;
 
            private string timeStampField;
 
            /// <remarks/>
            [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
            public string Success
            {
                get
                {
                    return this.successField;
                }
                set
                {
                    this.successField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
            [System.Xml.Serialization.XmlArrayItemAttribute("Tour", typeof(PI_TourAvailRSToursTour), Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)]
            public PI_TourAvailRSToursTour[][] Tours
            {
                get
                {
                    return this.toursField;
                }
                set
                {
                    this.toursField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string PrimaryLangID
            {
                get
                {
                    return this.primaryLangIDField;
                }
                set
                {
                    this.primaryLangIDField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string RequestedCurrency
            {
                get
                {
                    return this.requestedCurrencyField;
                }
                set
                {
                    this.requestedCurrencyField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string Target
            {
                get
                {
                    return this.targetField;
                }
                set
                {
                    this.targetField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string Version
            {
                get
                {
                    return this.versionField;
                }
                set
                {
                    this.versionField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string TimeStamp
            {
                get
                {
                    return this.timeStampField;
                }
                set
                {
                    this.timeStampField = value;
                }
            }
        }
 
        /// <remarks/>
        [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
        [System.SerializableAttribute()]
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.ComponentModel.DesignerCategoryAttribute("code")]
        [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
        public partial class PI_TourAvailRSToursTour
        {
 
            private string placesCoveredField;
 
            private string basicInfoField;
 
            private string tourCategoryField;
 
            private string thumbImageField;
 
            private PI_TourAvailRSToursTourDateRange[] dateRangeField;
 
            private PI_TourAvailRSToursTourRatesRate[][] ratesField;
 
            private string tourCodeField;
 
            private string tourNameField;
 
            private string totalDaysField;
 
            private string totalNightsField;
 
            private string displayOrderField;
 
            /// <remarks/>
            [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
            public string PlacesCovered
            {
                get
                {
                    return this.placesCoveredField;
                }
                set
                {
                    this.placesCoveredField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
            public string BasicInfo
            {
                get
                {
                    return this.basicInfoField;
                }
                set
                {
                    this.basicInfoField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
            public string TourCategory
            {
                get
                {
                    return this.tourCategoryField;
                }
                set
                {
                    this.tourCategoryField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
            public string ThumbImage
            {
                get
                {
                    return this.thumbImageField;
                }
                set
                {
                    this.thumbImageField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlElementAttribute("DateRange", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
            public PI_TourAvailRSToursTourDateRange[] DateRange
            {
                get
                {
                    return this.dateRangeField;
                }
                set
                {
                    this.dateRangeField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
            [System.Xml.Serialization.XmlArrayItemAttribute("Rate", typeof(PI_TourAvailRSToursTourRatesRate), Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)]
            public PI_TourAvailRSToursTourRatesRate[][] Rates
            {
                get
                {
                    return this.ratesField;
                }
                set
                {
                    this.ratesField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string TourCode
            {
                get
                {
                    return this.tourCodeField;
                }
                set
                {
                    this.tourCodeField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string TourName
            {
                get
                {
                    return this.tourNameField;
                }
                set
                {
                    this.tourNameField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string TotalDays
            {
                get
                {
                    return this.totalDaysField;
                }
                set
                {
                    this.totalDaysField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string TotalNights
            {
                get
                {
                    return this.totalNightsField;
                }
                set
                {
                    this.totalNightsField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string DisplayOrder
            {
                get
                {
                    return this.displayOrderField;
                }
                set
                {
                    this.displayOrderField = value;
                }
            }
        }
 
        /// <remarks/>
        [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
        [System.SerializableAttribute()]
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.ComponentModel.DesignerCategoryAttribute("code")]
        [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
        public partial class PI_TourAvailRSToursTourDateRange
        {
 
            private string validFromField;
 
            private string validToField;
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string ValidFrom
            {
                get
                {
                    return this.validFromField;
                }
                set
                {
                    this.validFromField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string ValidTo
            {
                get
                {
                    return this.validToField;
                }
                set
                {
                    this.validToField = value;
                }
            }
        }
 
        /// <remarks/>
        [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
        [System.SerializableAttribute()]
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.ComponentModel.DesignerCategoryAttribute("code")]
        [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
        public partial class PI_TourAvailRSToursTourRatesRate
        {
 
            private string codeField;
 
            private string rateCategoryField;
 
            private string perPersonRateField;
 
            private string singleRoomSupplementField;
 
            private string extraBedRateField;
 
            private string commissionField;
 
            private string transportField;
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string Code
            {
                get
                {
                    return this.codeField;
                }
                set
                {
                    this.codeField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string RateCategory
            {
                get
                {
                    return this.rateCategoryField;
                }
                set
                {
                    this.rateCategoryField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string PerPersonRate
            {
                get
                {
                    return this.perPersonRateField;
                }
                set
                {
                    this.perPersonRateField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string SingleRoomSupplement
            {
                get
                {
                    return this.singleRoomSupplementField;
                }
                set
                {
                    this.singleRoomSupplementField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string ExtraBedRate
            {
                get
                {
                    return this.extraBedRateField;
                }
                set
                {
                    this.extraBedRateField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string Commission
            {
                get
                {
                    return this.commissionField;
                }
                set
                {
                    this.commissionField = value;
                }
            }
 
            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute()]
            public string Transport
            {
                get
                {
                    return this.transportField;
                }
                set
                {
                    this.transportField = value;
                }
            }
        }
 
        /// <remarks/>
        [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "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 MyDataSet
        {
 
            private PI_TourAvailRS[] itemsField;
 
            /// <remarks/>
            [System.Xml.Serialization.XmlElementAttribute("PI_TourAvailRS")]
            public PI_TourAvailRS[] Items
            {
                get
                {
                    return this.itemsField;
                }
                set
                {
                    this.itemsField = value;
                }
            }
        }
    }
Posted 17-Dec-12 21:02pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Here is the idea for you:
http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer.aspx[^],
http://msdn.microsoft.com/en-us/library/ms733127.aspx[^].

There is no really a need to work with JSON or XML directly. The data contract serializers store any load (restore) any object graph for you.

—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 18 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100