私は概念実証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>