Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have created my first WCF Rest service looking at the post from Create and Consume RESTFul Service in .NET Framework 4.0[^]

First of all thanks for such an elaborate effort. It really helped me clear my concepts. However, when in place of Person class I use composite class, with following code,

C#
[DataContract(Namespace = "http://schemas.datacontract.org/2004/07/RESTFulDemo")]
   public class DutyScheduleModel
   {
[DataMember]
       public List<DutyModel> Duties { get; set; }

       public DutyScheduleModel()
       {
           Duties = new List<DutyModel>();
       }
   }

    [DataContract(Namespace = "http://schemas.datacontract.org/2004/07/RESTFulDemo")]
    public class DutyModel
    {
[DataMember]
        public List<dutyworkpiecemodel> DutyWorkPieces { get; set; }

        public DutyModel()
        {
            DutyWorkPieces = new List<dutyworkpiecemodel>();
        }
    }

C#
[DataContract(Namespace = "http://schemas.datacontract.org/2004/07/RESTFulDemo")]
    public class DutyWorkpieceModel
    {
}


The Service works fine. But while deserealizing at the service, It only returns the DutySchedule member properties, but not the List properties of dutymodel

I am banging my head over it for hours. Any help would be appreciated.
Posted
Updated 20-Aug-13 3:33am
v3
Comments
Jameel VM 20-Aug-13 10:13am    
can you post the srevice endpoints?
Naresh Padhy 20-Aug-13 11:06am    
Its the service with default ones
<standardendpoints>
<webhttpendpoint>
<standardendpoint name="" helpenabled="true" automaticformatselectionenabled="true" maxreceivedmessagesize="2147000000">


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900