Home Contact

Allan Rwakatungu's blog

Developer and Enterprise Architect

News

Twitter












Archives

Post Categories

Image Galleries

Syndication:

May 2008 Entries


Serializing an abstract data contract

Recently I needed to serialize abstract classes in WCF. The best way to explain it is with an example. I have a abstract class [KnownType(typeof(CreditCar... public abstract class Payment { private string _amount; private string _currency; [DataMember] public string currency { get { return _currency; } set { _currency = value; } } [DataMember] public string amount { get { return _amount; } set { _amount = value; } } } The class deriving it is [DataContract] public class CreditCardPayment:Payment...

Data Contacts in WCF

Why is this wrong. If I put void ProcessCreditCardPayment(Cr... creditcard) in the client and void ProcessCreditCardPayment(Cr... creditcards) in the service host it does not work. Why