Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

[RESOLVED] Return List will fail on WCF

$
0
0
So, i have this class that is referenced in both client and server app:
Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;


namespace WcfDataService
{
    [DataContract]
    [Serializable]
    public class MainDataClassLocal
    {

        [DataMember(Name= "AllowDBNull")]
        public bool AllowDBNull { get; set; }
        [DataMember(Name = "Caption")]
        public string Caption { get; set; }
        [DataMember(Name = "ColumnName")]
        public string ColumnName { get; set; }
        [DataMember(Name = "Datatype")]     
        public string Datatype { get; set; }
        [DataMember(Name = "MaxLength")]
        public int MaxLength { get; set; }
        [DataMember(Name = "Readonly")]
        public bool Readonly { get; set; }
    }

    [DataContract]
    [Serializable]
    public class RootObjectLocal
    {
        public List<MainDataClassLocal> maindataclassLocal { get; set; }
    }

 
}

However when i pass it from the client app to WCF with data, i get an empty class (=null) . I went to the client service configuration and changed the type to system.collection.generic.list but still it will return null.
Any help?

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>