I need to accept various profiles as an input to the web service.
[DataContract]
public class ProfileRequest
{
[DataMember]
public virtual string address { get; set; }
[DataMember]
public virtual string type { get; set; }
[DataMember]
public virtual string speed { get; set; }
}
I was thinking of using an IList of profiles like this:
[OperationContract]
IList<ProfileRequest> profiles
It occurs to me… perhaps IList doesn’t exist in all languages, so would be considered bad practice to expose a data contract like this? Should I stick only to simple types, so that the service can be more easily used by non WCF services?
this is fine. for example the following c# contract:
will appear like this xml schema in the wsdl:
so this is just an array for consumers. of course if you target for interoperability with a specific client stack you should proactively verify interoperability.