I want to display document for specified Document Id. For this, I am calling WCF service from MVC project.
In MVC project, in HomeController.cs
FileStreamResult objFileStreamResult = (FileStreamResult)objDocumentServiceClient.RetrieveDocument(DocId);
In WCF Service project, in DocumentService.svc.cs
public FileStreamResult RetrieveDocument(int DocumentID)
Error:
Type 'System.Web.Mvc.FileStreamResult' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. ÿIf the type is a collection, consider marking it with the CollectionDataContractAttribute.
Could anyone please tell me what am I doing wrong?