简体   繁体   English

WCF服务抽象类作为方法参数

[英]Wcf service Abstract class as Method argument

I got some wcf service. 我得到了一些WCF服务。 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. 所以我需要将ClassAClassB Array传递给我的服务。 How should i mark my classes to make it visible in service metadata, and overall make that right? 我应该如何标记我的类以使其在服务元数据中可见,并且总体上做到这一点?

查看KnownTypeAttribute

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用抽象类作为方法参数的WCF服务 - WCF Service with abstract class as method parameter 将Abstract Class作为方法中的参数传递 - Passing an Abstract Class as an argument in an Method 当引用抽象类时,C#WCF服务参考公开具体类而不是继承的抽象类 - C# WCF Service Reference exposes concrete class instead of inherited abstract class when abstract class is referenced 无法在WCF Silverlight服务上创建抽象类或接口的实例 - Cannot create an instance of the abstract class or interface on WCF Silverlight Service WCF抽象基类,在服务响应中不包含用于反序列化的抽象类型的复杂集合 - WCF Abstract base class with complex collection of abstract types not being included for deserialization in service response 抽象类的参数验证 - Argument validation of abstract class 具有抽象请求类型的WCF Rest方法-错误:无法创建抽象类 - WCF Rest Method with abstract request type - Error: Cannot create an abstract class 带有Interface参数的WCF调用服务方法导致SocketException - WCF calling service method with an Interface argument results in SocketException WSCF生成的WCF服务。blue服务错误“实现类型是接口或抽象类,没有提供实现对象” - WCF service generated by WSCF.blue Service Error “implementation type is an interface or abstract class and no implementation object was provided” 非抽象类中的抽象方法 - Abstract Method in Non Abstract Class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM