Hi There.
I am trying to design an Picture Upload feature into a web site. I am using ASP.NET 3.5, C#, and WCF.
I have been asked to accomplish the following:
1) Make the Uploader a Web Service
2) Return progress updates to the user as files are uploaded.
3) Log other relevant user-selected options in the database.
So, I have started off by creating a WCF web client with the below service contract:
IService.UploadPictures(HttpRequest request);
private UploadServiceClient upload;
protected void Page_Load(object sender, EventArgs e)
{
upload = new UploadServiceClient();
upload.UploadPictures(Request.Files);
}
When I compile, I get the below error:
Type 'System.Web.HttpRequest' cannot be serialized. Consider marking it with the DataContractAttribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.
So, I went back into my service contract and changed [OperationContract] to [DataContract] but the change produced the same error.
Can somebody kindly tell me what I am doing wrong and provide examples as to how to best move forward?
Thanks for your time.