Last post Sep 02, 2009 01:45 PM by tvish
Aug 28, 2009 04:33 PM|monfu|LINK
I have a WCF returning a list of Articles as follows :-
public class ArticleService : IArticleService
public IQueryable<Article> FindAllArticles()
IArticleService contains the followng code
Then I am adding a Service reference to this ArticleService and calling it
ArticleService.ArticleServiceClient client = new ArticleServiceClient();
// GET: /Article/
public ActionResult Index(int? page)
var fullArticleList = client.FindAllArticles();
const int pageSize = 2;
However I am getting the following errors:-
1) the fullArticleList is just an object and not a IQueryable<Article> as I am stating in my WCF Service
2) When running the application and referencing the var fullArticleList = client.FindAllArticles();
I am getting the following error
"The underlying connection was closed: The connection was closed unexpectedly"
Am I doing something wrong?
Thanks for your help and time
Aug 31, 2009 06:49 AM|Shakti Singh Tanwar|LINK
This is a serialization issue with WCF. Your Datacontract contains a type which DataContractSerializer is not able to serialize. Could you please post your data contract?
Sep 02, 2009 01:45 PM|tvish|LINK
Shakti is right - IQueryable<T> is not serializable by DataContractSerializer. Can you return a List<T> instead?