Look into KnownTypeAttribute.
Wcf service Abstract class as Method argument
Pergunta
I got some wcf service. I got also:
[DataContract]
public abstract class BaseClass
{
}
[DataContract]
public class ClassA : BaseClass
{
[DataMember]
//some data members
}
[DataContract]
public class ClassB : BaseClass
{
[DataMember]
//some data members
}
I got method
[OperationContract]
public void SendData(BaseClass[] data);
So i need to pass Array
of ClassA
and ClassB
to my service.
How should i mark my classes to make it visible in service metadata, and overall make that right?
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow