Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 402199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:06:12+00:00 2026-05-12T17:06:12+00:00

I am trying to design an Picture Upload feature into a web site. I

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:06:12+00:00Added an answer on May 12, 2026 at 5:06 pm

    You cannot use something like a HttpRequest as a WCF parameter. The error messages says it all – the HttpRequest is not serializable, and in order to work with WCF, types have to be serializable.

    Also, you need to remember: you’re not just passing an object instance to a method here – what you’re really doing is having the WCF runtime serialize your request (the method name to call plus all the parameters passed in) into a message (think: e-mail or xml file), sending it to the server, deserialising there and building up a new copy of the given datatype (as defined in your DataContract), and doing something with it.

    Your WCF service could well be self-hosted, e.g. running in a NT Service or console app – no HttpRequest available in those circumstances!

    You need to definitely rearchitect your solution – you need to either check into WCF streaming to upload files to WCF (google for it – you’ll find plenty of hits) or you’ll need to find another way to pass the relevant info (e.g. list of filenames) to the WCF service without use of a HttpRequest object.

    Marc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to design a view using asp.net mvc 3 RC. I am
I'm trying to design my app's interface in IB using a storyboard and have
I have been using Twitter Bootstrap 2.1 in my latest design. For some reason
I've been trying to design support for recurring events (like you would see in
I'm trying to wrap my brain around JMS and have been reading up on
Sorry for troubling. Im trying to display the selected fields in a asp.net gridview.
I'm trying to design a database model and I have a question. I need
I am trying to design a windows form application. Now I have written an
I'm trying to create a design where I have a div for an image,
I am trying to make the jump from data-centric design and development into DDD

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.