Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2005

Tip: Looking for answers? Try searching our database.

Serialization.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Burton - 04 May 2005 18:51 GMT
Hopefully this is the right group.

I am getting the following exeption:

Member 'PPRP602AType.RPLY_HEADER' hides inherited member
'REPLYType.RPLY_HEADER'
, but has different custom attributes.
  at
System.Xml.Serialization.StructMapping.FindDeclaringMapping(MemberMapping
member, StructMapping& declaringMapping, String parent)
  at System.Xml.Serialization.StructMapping.Declares(MemberMapping member,
Stri
ng parent)
  at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(Str
uctModel model, String ns)

The 'REPLYType.RPLY_HEADER' is abstract and specified as:

    public abstract class REPLYType
    {
        #region Accessor Functions
        public abstract RPLY_HEADERType RPLY_HEADER
        {
            get;
            set;
        }
        #endregion
    }

Then I derive from there

    public sealed class PPRP602AType : REPLYType

and implement the abstract property:

        #region Private Members
        private RPLY_HEADERType _RPLY_HEADER;
        #endregion
        #region Accessor Functions
        [XmlElement(ElementName="RPLY_HEADER_PPRP602A")]
        public override RPLY_HEADERType RPLY_HEADER
        {
            get
            {
                return _RPLY_HEADER;
            }
            set
            {
                _RPLY_HEADER = value;
            }
        }
        #endregion

What am I doing wrong? Why the serialization exception?

Thank you.

Kevin
erymuzuan - 05 May 2005 01:55 GMT
Xml Serialization never take attribute with it in inheritance chains ,
so you have to copy and paste the attribute if any exists between your
base class and derive class

regards
erymuzuan mustapa

> Hopefully this is the right group.
>
[quoted text clipped - 55 lines]
>
> Kevin
Kevin Burton - 05 May 2005 02:24 GMT
The abstract class is not decorated at all. The overridden property is
decorated as below. How should this change to avoid the exception?

Kevin

> Xml Serialization never take attribute with it in inheritance chains ,
> so you have to copy and paste the attribute if any exists between your
[quoted text clipped - 62 lines]
> >
> > Kevin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.