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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:24:45+00:00 2026-05-29T10:24:45+00:00

Is a parameterless constructor of a Request DTO required in ServiceStack If I comment

  • 0

Is a parameterless constructor of “a Request DTO” required in ServiceStack

If I comment out the parameterless constrctor

[DataContract]
[RestService("/Competitions/", "GET")]
[RestService("/Competitions/{Id}", "GET")]
public class Competitions
{
    [DataMember]
    public int CompetitionID { get; set; }
    [DataMember]
    public string CompName { get; set; }
    [DataMember]
    public string CompType { get; set; }
//public Competitions()
//{ 

//}

public Competitions(ABC abc)
    {
    this.CompetitionID = abc.abcID;
    this.CompName = abc.CompName;
    this.CompType = abc.CompType;
    }
}

I will get an exception “No parameterless constructor servicestack” when accessing the metadata page http://localhost/api/xml/metadata?op=Competitions

The stacktrace is

[External Code] 
    ServiceStack.DLL!ServiceStack.WebHost.Endpoints.Metadata.XmlMetadataHandler.CreateMessage(System.Type dtoType = {Name = "Competitions" FullName = "FSI.API.ServiceModel.Competitions"}) Line 17 + 0x8 bytes C#
    ServiceStack.DLL!ServiceStack.WebHost.Endpoints.Metadata.BaseMetadataHandler.ProcessOperations(System.Web.UI.HtmlTextWriter writer = {System.Web.UI.HtmlTextWriter}, ServiceStack.ServiceHost.IHttpRequest httpReq = {ServiceStack.WebHost.Endpoints.Extensions.HttpRequestWrapper}) Line 56 + 0xe bytes    C#
    ServiceStack.DLL!ServiceStack.WebHost.Endpoints.Metadata.BaseMetadataHandler.Execute(System.Web.HttpContext context = {System.Web.HttpContext}) Line 34 C#
    ServiceStack.DLL!ServiceStack.WebHost.Endpoints.Support.HttpHandlerBase.ProcessRequest(System.Web.HttpContext context = {System.Web.HttpContext}) Line 20   C#
[External Code] 
  • 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-29T10:24:45+00:00Added an answer on May 29, 2026 at 10:24 am

    The XmlSerializer needs a constructor to work, you can make it internal, private or protected if you want.

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

Sidebar

Related Questions

In base class constructors I always see a parameterless constructor, like so: public abstract
Possible Duplicate: Why XML-Serializable class need a parameterless constructor Does anyone know if it
What is special about addid a parameterless constructor to a non serializable, extendable class.
EF requires parameterless constructor but is it possible to override this some how? public
The type argument must have a public parameterless constructor. When used together with other
In Flex ActionScript, a new object can be instantiated via the parameterless constructor with
Why does the parameterless Guid constructor generate an empty GUID rather than default to
I'm trying create a ASMX webservice that can perform a HTTP GET request. I
I have a class MyEntity, which does not have a default constructor (well, it
I am always getting the error No parameterless constructor defined for this object. when

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.