Not all parameters in WCF data contract make it through the web service call

后端 未结 1 1886
无人及你
无人及你 2020-12-19 05:30

While creating a WCF Rest service, I\'ve noticed that not all the parameters in my web service are making it into my implementation.

Here\'s the interface:



        
相关标签:
1条回答
  • 2020-12-19 05:49

    By default when you send an object through wcf the properties will be sent in Alphabetical order unless you specify the order.

    You can specify the order of the properties or change the ordering so that they appear in alphabetical order.

    [DataContract(Namespace="http://example.com/recordservice")]
    public class Appointment
    {
        [DataMember(Order = 1)]
        public int ResponseType { get; set; }
    
        [DataMember(Order = 2)]
        public int ServiceType { get; set; }
    
        [DataMember(Order = 3)]
        public string ContactId { get; set; }
    
        [DataMember(Order = 4)]
        public string Location { get; set; }
    
        [DataMember(Order = 5)]
        public string Time { get; set; }        
    }
    
    0 讨论(0)
提交回复
热议问题