As far as I remember you can serialize TypedViews from a WCF service in v3.x as follows:
Using the WCF example posted on our website, I added the folowing code, and it works perfectly.
NorthwindService.cs (the WCF interface)
[ServiceKnownType(typeof(InvoicesTypedView))]
public interface INorthwindService
{
[OperationContract]
ITypedView2 GetInvoices();
CustomerService.cs (The service implementation)
public ITypedView2 GetInvoices()
{
var invoices = new InvoicesTypedView();
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchTypedView(invoices, null, 5, false);
}
return invoices;
}
The client code:
InvoicesTypedView invoices = (InvoicesTypedView) DalService.GetInvoices();
When you host the WCF service on IIS, and access it from the client application, it works perfectly.
The issue is that you are trying to access the service from the Browser. And this won't work, as the Browser.. (i.e. the WSDL) have no idea about the special types you use in the service.
Now you would ask why the service shows no error when we remove the method which returns a TypedView, although we have methods returning entityCollection and entities.
My guess would be the WSDL don't try to serialize/deserialize objects it doesn't know, so it won't fail trying to work with Entities and EntityCollection.
But in the case of a TypedView, it sees it as a DataTable (since TypedView inherits from DataTable), but when it tries access the rows and the columns it fails. That's why we might want to return a dataTable, instead of the TypedView type.
No food for three days doesn't focus the mind, apologies to Walaa for my shortness.
No problem at all, sorry to hear about your illness, hope you are much better now.