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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:41:10+00:00 2026-05-31T19:41:10+00:00

I created a WCF service and to the default service I added another operation

  • 0

I created a WCF service and to the default service I added another operation contract on the main DataContract:

[OperationContract]
void DoSomething(UserData data);

Then I have something like this (simplified for the purpose of example) below. The problem is that even though ALL classes in the hierarchy are decorated with DataContract and ALL their members decorated with DataMember, when I use the WCF Test Client it has a red icon indicating that “the operation is not supported in the WCF test client”.

[DataContract]
public class UserData {
   [DataMember]
   public uint One { get; set; }

   [DataMember]
   public CompositeType Extra { get; set; }

   public UserData() { ctor. code }
}


[DataContract]
public class CompositeType {
    [DataMember]
    public uint Two { get; set; }

    public UserData() { ctor 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-31T19:41:11+00:00Added an answer on May 31, 2026 at 7:41 pm

    Add the attribute to your ‘UserData’ class [KnownType(typeof(CompositeType))]

    Like:

    [DataContract]
    [KnownType(typeof(CompositeType))]
    public class UserData 
    {
       [DataMember]
       public uint One { get; set; }
    
       [DataMember]
       public CompositeType Extra { get; set; }
    
       public UserData() { ctor. code }
    }
    

    http://msdn.microsoft.com/en-us/library/ms730167.aspx

    Edit:

    http://msdn.microsoft.com/en-us/library/system.operatingsystem.aspx

    The OperatingSystem class has a few properties which relate to other classes. You could include all these classes in the known types but the dependency chain could get rather large and I would highly recommend not using the Operating System class at all.

    You should work out what information you actually need from the Operating System class and create your own DTO to pass back in the response. That way you can ensure all the types are easily definable on your contract.

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

Sidebar

Related Questions

Created .NET WCF service, tested it - works. Generated schemas from Data and service
I created a WCF service (.NET 3.5) that grabs data from a db and
I've created 3 projects: WcfServer -- The default WCF Service Library project, unchanged. WcfServerConsole
I've created the default WCF Service in VS2008. It's called Service1 public class Service1
I created WCF RIA services. It added app.config by default. But there is no
I created a WCF service in Windows Azure project (with 1 WCF Service Web
I created a WCF service that uses TagLib# ( http://developer.novell.com/wiki/index.php/TagLib_Sharp ) which relies on
I've successfully created a WCF service that works how I want it to. The
I have created a WCF service for uploading images , which accepts System.IO.Stream as
I've created a Wcf Service to back a Ajax page (.Net 3.5). It's hosted

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.