I have tried a lot of solutions from the internet. But I am not able to resolve this problem.
I have tried solutions from these links below:
WCF Proxy Returning Array instead of List EVEN THOUGH Collection Type == Generic.List
WCF Returning Array instead of List EVEN THOUGH Collection Type == Generic.List
Why does WCF return myObject[] instead of List<T> like I was expecting?
But I am not able to resolve it.
I have 2 copies of the same wcf service source code "WCFServiceApplication". One is hosted on LAN on IIS7 and Other one is am running locally in my solution.
The one which is hosted on IIS7 is working fine and returning list of objects. But the one on my local solution. I am trying to reference locally in solution to consume "WCFServiceApplication" functions in one of my local project named "MyProjectLibrary.csproj".
But here i have the problem. It is not giving me the Generic List of my custom class objects.
Any help is appreciated.
Thanks
I am Returning the List of below class:
[DataContract(IsReference = true)]
[KnownType(typeof(Joc))]
[KnownType(typeof(Stakeholder))]
[XmlInclude(typeof(JocStakeholder))]
public class JocStakeholder
{
[DataMember]
public long ID { get; set; }
[DataMember]
public virtual Joc joc { get; set; }
[DataMember]
public virtual Stakeholder stakeholder { get; set; }
}
Joc and Stakeholder are 2 other classes. Actually, these are code first entities.
And My interface has this function:
[ServiceContract]
public interface IService
{
[OperationContract]
public IList<JocStakeholder> GetJocStakeHolders();
}