0
我构建了一个概念证明WCF服务,并且有意构建出所有接口以避免在必要时提供任何具体实现。我想将结果合同(包括消息定义)发送给另一个团队,以开始构建我正在构建的合同,但消息参数未被序列化,除非我提供用DataContractAttribute装饰的类。有没有办法让我继续使用松散耦合的接口来定义我的合同,还是需要使用类来构建我的所有消息?WCF定义WSDL中的接口契约
示例服务
[ServiceContract]
public interface ITestService
{
[OperationContract]
ITestResponse TestOperation(ITestRequest request);
}
public interface ITestRequest
{
string Message { get; set; }
}
public interface ITestResponse
{
bool Success { get; set; }
}
例XSD定义
<xs:element name="TestOperation">
<xs:complexType>
<xs:sequence>
<!--I want this to be a reference to a complex type with definition of it's members-->
<xs:element minOccurs="0" name="result" nillable="true" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>