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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:56:34+00:00 2026-06-04T08:56:34+00:00

Over the last month I have noticed an odd behavior where the wrong REST

  • 0

Over the last month I have noticed an odd behavior where the wrong REST service is called with service stack.

Everything seems to be working and then when I add a new REST service, some how my working REST service is not working correctly (i.e. the wrong REST service is called).

I will explain how I have my datacontracts for the services which may explain why I am getting the problem.

I initially had:

[DataContract(Name = "MyService", Namespace = "")]
[RestService("/api/v1/dvbs/{ServiceName}", "GET", "application/xml")]
public class GetServiceDto
{
    [DataMember(Name = "SessionId", Order = 1)]
    public string SessionId { get; set; }
    [DataMember(Name = "UserName", Order = 2)]
    public string UserName { get; set; }
    [DataMember(Name = "ServiceName", Order = 3)]
    public string ServiceName { get; set; }
}

and as I was passing the same data (sessionid, username and servicename) in all my calls, any new service started as:

[DataContract(Name = "MyService", Namespace = "")]
[RestService("/api/v1/dvbs/{ServiceName}/tuners", "GET", "application/xml")]
public class GetTunersDto : GetServiceDto
{
}

As I mentioned this all worked fine but when I added a new service, when I called “api/v1/dvbs/{ServiceName} the service “api/v2/dvbs/{ServiceName}/tuners” would be called.

I removed the inherited relationship so that I have :

[DataContract(Name = "MyService", Namespace = "")]
[RestService("/api/v1/dvbs/{ServiceName}/tuners", "GET", "application/xml")]
public class GetDvbConfigTunersDto
{
    [DataMember(Name = "SessionId", Order = 1)]
    public string SessionId { get; set; }
    [DataMember(Name = "UserName", Order = 2)]
    public string UserName { get; set; }
    [DataMember(Name = "ServiceName", Order = 3)]
    public string ServiceName { get; set;}
}

and it works fine now.

What is strange is it was working fine and only when I added a new service at a later date that the wrong mapping incurred.

Any ideas?

  • 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-04T08:56:35+00:00Added an answer on June 4, 2026 at 8:56 am

    You can only have 1 Request DTO per service and inheriting Request DTOs inherits the attribute routes which makes it GetTunersDto inherit the same routes as GetServiceDto which populates ServiceStack with conflicting and ambiguous routes.

    The solution is to not use inheritance on DTOs (especially Request DTOs).

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

Sidebar

Related Questions

After playing quite a bit of Bad Company 2 over the last month, I'm
Over the last few weeks I have been studying the MVC design pattern for
Possible Duplicate: SpecFlow/BDD for Unit Tests? Over the last few years I have worked
Over the last few months/years, I have shared a folder or two with numerous
Over the last couple of months I've been working on some implementations of sockets
Over the last 18 months i have been hard at work teaching myself PHP
I have been developing an application over the last few months using EF code
A number of times over the last month I've had to replace 'null' fields
Over the last couple months I've been working with programs that involve multi-threading aspects
Over the last few months I've often come across the same Design obstacles 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.