I have an array of enumerations on a WCF reuqest that comes through as null
, no matter what I have tried.
The service works apart from the issue with enumerations.
Does anyone have any ideas why this might be?
Enumeration code:
[DataContract(Namespace = "http://services.myproject.com/requests/MyProject")]
public enum Recommendation
{
[EnumMember]
One = 1,
[EnumMember]
Two = 2,
}
SOAP XML:
... xmlns:lat="http://services.myproject.com/requests/MyProject" ...
...
<lat:Recommendations>
<Recommendation>One</Recommendation>
<Recommendation>Two</Recommendation>
</lat:Recommendations>
...
C#:
[DataContract(Namespace = "http://services.myproject.com/requests/MyProject")]
public class MyRequest : Request ...
{
//...
[DataMember]
public Recommendation[] Recommendations { get; set; }
//...
}