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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:24:36+00:00 2026-05-22T17:24:36+00:00

More specifically, the question is: How to serialize a class with WCF that has

  • 0

More specifically, the question is:
How to serialize a class with WCF that has (must have) interface types in property signatures because it implements an interface?

This is a design question. I’m not looking for a hack.
The purpose is to keep the interface definitions separate from implementing classes and hence not let interfaces refer to implementing classes.

I know that we’re not supposed to pass around interfaces with WCF and
also that there are still (non-interoperable) ways to do it (like using NetDataContractSerializer or the ServiceKnownType attribute), but that leaves me with the question: is there a proper way to use classes based on interfaces with WCF or should this not be attempted at all?

  • 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-22T17:24:36+00:00Added an answer on May 22, 2026 at 5:24 pm

    I found a solution to my own specific problem.

    The problem was that I was marking the properties (of an interface type) as DataMember. By instead marking corresponding private members as DataMember (and make sure that their types are concrete classes) the problem is solved.

    Example:

    [DataContract()]
    public class Company : ICompany
    {
        [DataMember(Name = "Employees")]
        private EmployeeList _employees;
    
        public IEmployeeList Employees { get { return _employees; }}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

More specifically, if I have: public class TempClass : TempInterface { int TempInterface.TempProperty {
( insert really basic question disclaimer here ) More specifically, I have the following
That is my question. More specifically, I'm trying to get used to Eclipse's debugger
I have a question about solrnet, and more specifically about mapping fields to C#
I have a question regarding the upgrade procedure of an App, more specifically, upgrading
This question is related to extending class methods in Ruby, perhaps more specifically in
I have some questions about logging, more specifically about setting it up and making
More specifically, does NDK have a complete STL implementation. We're looking at this for
In .Net (VB more specifically, but that doesn't really matter), is there a way
I was of the idea that flash (more specifically Adobe's flash player browser plugin)

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.