1

We have a C# webservice where in the request comes in from another application. We have a a method A(B b). The structure of B is

[Serializable]
[DataContract]
Public Class B
{
  [Datamember]
  public List<int> D {get;set;}
  [Datamember (isrequired=true)]
  public string C {get;set;}
}

We now are facing an issue , when the calling application passes C ahead of D in the request , we do not recieve D , but when C is passed after D is passed , we get both values correctly. Is there an order

Kirk Woll
  • 76,112
  • 22
  • 180
  • 195
RowLand
  • 61
  • 1
  • 8
  • What do you mean is there an order? – Celt Jan 29 '15 at 16:31
  • 1
    [Yes, order is important](https://msdn.microsoft.com/en-us/library/ms729813%28v=vs.110%29.aspx). See also [In XML, is order important?](http://stackoverflow.com/questions/1131495/in-xml-is-order-important). – CodeCaster Jan 29 '15 at 16:37

1 Answers1

0

DataMemberAttribute has the property Order.

Also see this duplicate SO question, WCF Datacontract, some fields do not deserialize

Community
  • 1
  • 1
jamier
  • 802
  • 1
  • 8
  • 9