개념 증명 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>