我可以在 WCF 中使用递归 MessageContract 吗?例如 :
我需要发布一些参数,其中一个参数是文件流数组。这是我的 OperationContract :
DomainResult AddSomethingNew(int externalCustomerId, string domainName, bool isDefault, FileDataContract[] files);
这是我的 MessageContract :
[MessageContract]
public class FileDataContract
{
[MessageHeader(MustUnderstand=true)]
public int ExternalCustomerId { get; set; }
[MessageHeader(MustUnderstand=true)]
public string DomainName{get;set;}
[MessageHeader(MustUnderstand=true)]
public bool IsDefault{get;set;}
[MessageBodyMember(Order=1)]
public FileUploadInputParameter[] Files { get; set; }
}
[MessageContract]
public class FileUploadInputParameter
{
[MessageHeader(MustUnderstand = true)]
public string FileName { get; set; }
[MessageHeader(MustUnderstand = true)]
public decimal FileSize { get; set; }
[MessageBodyMember(Order = 1)]
public Stream FileStream { get; set; }
}
需要你的帮助..