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 7984199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:11:36+00:00 2026-06-04T11:11:36+00:00

I have a webservice which I have edited, before it worked without a problem.

  • 0

I have a webservice which I have edited, before it worked without a problem. however right now im getting this error: cannot be serialized because it does not have a parameterless constructor I have posted my class below.

public class Class
{
    public class AnsweredQ
    {
        public string Question { get; set; }
        public string Answer { get; set; }

        public AnsweredQ(string _Question, string _Answer)
        {
            Question = _Question;
            Answer = _Answer;
        }
    }
    public class UnAnsweredQ
    {
        public string Question { get; set; }
        public string[] Options { get; set; }

        public UnAnsweredQ(string _Question, string[] _Options)
        {
            Question = _Question;
            Options = _Options;
        }
    }
    public class Trial
    {
        public string User { get; set; }
        public DateTime TrialDate { get; set; }
        public bool Expired { get; set; }

        public Trial (string _User, DateTime _TrialDate, bool _Expired)
        {
            User = _User;
            TrialDate = _TrialDate;
            Expired = _Expired;
        }
    }
}

if you can solve this please explain what i did wrong 🙂

  • 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-06-04T11:11:37+00:00Added an answer on June 4, 2026 at 11:11 am

    To be able to serialize / deserialize a class, the serializer requires a parameterless constructor. So, you need to add the parameterless constructors to your classes, i.e.:

    public class AnsweredQ
        {
            public string Question { get; set; }
            public string Answer { get; set; }
    
           public AnsweredQ() {  }
    
    
            public AnsweredQ(string _Question, string _Answer)
            {
                Question = _Question;
                Answer = _Answer;
            }
        }
        public class UnAnsweredQ
        {
    
    
            public string Question { get; set; }
            public string[] Options { get; set; }
    
            public UnAnsweredQ() {}
    
            public UnAnsweredQ(string _Question, string[] _Options)
            {
                Question = _Question;
                Options = _Options;
            }
        }
    
    
        public class Trial
        {
            public string User { get; set; }
            public DateTime TrialDate { get; set; }
            public bool Expired { get; set; }
    
            public Trial ()
            {
            }
    
            public Trial (string _User, DateTime _TrialDate, bool _Expired)
            {
                User = _User;
                TrialDate = _TrialDate;
                Expired = _Expired;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have a WCF Webservice which can be used by customers to upload
I have an ASP.net WebService which uses a Library, this has a dependency on
I have ran into a really annoying issue which gives me this error: The
I have an asp.net webservice which is giving me this: <ArrayOfString> <string>Musterbetrieb</string> <string>Testbetrieb</string> </ArrayOfString>
I have a webservice which populates my DataGridView using a couple of webmethods. Without
I have a problem that, I have a webservice which returns 3 arrays from
I have problem with querying webservice which uses WS-Security. I use code creadted by
I have a webservice which return this kind of json object : { dossiers:
I have a restful webservice which receives some structured data which is put straight
I have a .NET webservice which I need to hit asynchronously from the jQuery

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.