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

  • Home
  • SEARCH
  • 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 6759691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:58:35+00:00 2026-05-26T13:58:35+00:00

I have a DataContract which I use as a return type from a WCF

  • 0

I have a DataContract which I use as a return type from a WCF service.

[DataContract]
public NameResult
{
    [DataMember]
    public string Name { get; set; }
}

However, I want to store additional information on the service side, so I create a subclass:

internal ServiceNameResult : NameResult
{
    internal Guid ID { get; set; }
}

However, it seems I am unable to use instances of this as a result value (the error I get on the client isn’t very helpful – Unrecognized error 109 (0x6d).

Basically, if I do;

NameResult GetName() 
{
    NameResult result = {...}
    return result;
}

Then it works, but if I do;

NameResult GetName()
{
    ServiceNameResult result = {...}
    return result;
}

It doesn’t. I don’t really want to have to copy the properties from the ServiceNameResult to a new NameResult. Hopefully there is a way to make this work?

I’ve already put [IgnoreDataMember] on the subclass, but that makes no difference.

Thanks.

  • 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-26T13:58:35+00:00Added an answer on May 26, 2026 at 1:58 pm

    Here is one way to approach this problem. You could use composition to achieve what you’re looking for:

    internal class ServiceNameResult
    {
        object OtherInformation { get; set; }
    
        NameResult Result { get; set; }
    }
    

    So your internal service implementation can hold a reference to the client return object as well as additional information, but you don’t pollute your interface.

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

Sidebar

Related Questions

I have a WCF service which all operations return type is OperationStatus: [DataContract] public
I have several service contracts exposed over WCF, which use multiple datacontracts. The service
I have a method in a WCF service which returns a complex type (myComplexResult),
I have a simple class I'm serializing. [DataContract(Name = Test, Namespace = )] public
I have a quite simple WCF service method which returns an IQueryable, just for
I have a custom collection which i want to expose from the WCF web
I have a wcf web service which is configured for JSON. But my data
I have a C# WCF REST Service which allows the addition of a bookmark,
I have a .NET type, which is attributed with neither ProtoContract nor DataContract. In
I have an Operation Contract in my WCF service which returns an instance of

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.