Question

I am making a WCF service, and I want to make certain DataMembers which are string values of my requests required (i.e., not null, not empty), because we have institutional/legal access logging requirements to sensitive data (we need to log by whom and when the access was made)

I'm guessing that some of this is the fact that my DataMembers are strings, and that strings that are null can be valid. Can anyone help me with this definition?

namespace CrdWcfServiceInterface.Request
{
    [DataContract]
    public class GetPatientDemographicsRequest
    {
       [DataMember]
       public string PatientID { get; set; }
       [DataMember(IsRequired=true)]
       public string RequesterLanID { get; set; }
       [DataMember(IsRequired=true)]
       public string ApplicationName { get; set; }

    }
}
Était-ce utile?

La solution

Please take a look at integrating the Enterprise library blocks to handle the validation alongwith WCF as shown here

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top