operationcontract

WCF: is there an attribute to make parameters in the OperationContract required?

家住魔仙堡 提交于 2019-11-28 03:32:51
问题 I use [DataMember(IsRequired=true)] to make the DataContract properties required. There doesn't seem to be some IsRequired for the OperationContract parameters. How do I make them required and not allow null? The parameter in of OperationContract appears to be optional in SoapUI tool. Though this must never be optional or null. WCF Interface: [OperationContract] IsClientUpdateRequiredResult IsClientUpdateRequired(IsClientUpdateRequiredInput versie); ... [DataContract] public class

WCF OperationContract - which generic collection type should I expose?

人走茶凉 提交于 2019-11-28 03:19:34
问题 I have a WCF web service that has a method that returns a generic collection. Now, my question is: Should I expose it as ICollection<T> , List<T> , IList<T> , IEnumerable<T> or something else? I suppose that List<T> is out of the question since I want to avoid CA1002 errors, but the underlying type will be a List<T> . I am really interested in hearing your takes on this, preferably with a good explanation of why you think what you think. Thanks in advance 回答1: Keep in mind that errors such as