Link to home
Start Free TrialLog in
Avatar of DEALOGIC
DEALOGIC

asked on

WCF MSMQ unable to serialize interface of DataContract

Hi,

I am trying to send a datacontract object to message queue. one of the property is return a interface type.

I get this errors:

{"Cannot serialize member Dealogic.ClientManager.Domain.DataTransferObjects.
ContentTransferObject.Analyst of type Dealogic.ClientManager.Domain.Interfaces.
IAnalyst because it is an interface."}

did I miss any attribute?
One of the solution I found is changing the IAnalyst to an abstract class and use XMLInclude
but that would require a major change. any other work around?

thank you,
DL
[DataContract]
    [KnownType( typeof( AnalystTransferObject ) )]
        public class ContentTransferObject : BaseTransferObject, IContent  {

        [DataMember]
        public ContentType ContentType { get; set; }

        [DataMember]
        public int ContentNo { get; set; }

        [DataMember]
        public string Headline { get; set; }

        [DataMember]
        public IAnalyst Analyst { get; set; }
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial