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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:27:40+00:00 2026-05-20T07:27:40+00:00

Im am not new to WCF web services but there has been a couple

  • 0

Im am not new to WCF web services but there has been a couple of years since the last time I used one. I am certain that last time I used a WCF service you could determine the type of object returned from a service call when developing the code. EG;

MyService.Models.ServiceSideObjects.User user = myServiceClient.GetUser();

You were then free to use the ‘user’ object client-side. However now it seems as if the WCF service will not return anything more than objects containing basic value types (string, int ect). So far I have remedied this by defining transfer objects which contain only these basic value types and having the service map the complex ‘User’ objects properties to simple strings and int’s in the transfer object.

This becomes a real pain when, for example you have custom type objects containing more complex objects such as my Ticket object.

public class Ticket
{
    public Agent TicketAgent {get;set;}
    public Client Owner {get;set;}
    public PendingReason TicketPendingReason {get;set;}
}

As simply mapping this object graph to a single transfer class with a huge list of inter-related system-typed properties gives a very ‘dirty’ client-side business model. Am I wrong in thinking that I SHOULD be able to just receive my Ticket object from a service method call and deal with it client side in the same state it was server-side ?

I realise this is probably a violation of some SoA principal or similar but my desktop app currently consuming this service is the ONLY thing that will consume ever consume it. So i do not care if many other clients will be able to manage the data types coming back from the service and therefore require some hugely normalised return object. I just want my service to get an object of type Ticket from its repository, return this object to the client with all its properties intact. Currently all I get is an object with a single property ‘ExtentionData’ which is unusable client-side.

Hope this makes sense, thank you for your time.

  • 1 1 Answer
  • 4 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-20T07:27:41+00:00Added an answer on May 20, 2026 at 7:27 am

    I might’ve missed a memo, but I think you need to decorate your model classes with DataContractAttribute and your properties with DataMemberAttribute, like so:

    [DataContract( Namespace = "http://example.com" )]
    public class Ticket
    {
        [DataMember]
        public Agent TicketAgent { get; set; }
    
        [DataMember]
        public Client Owner { get; set; }
    
        [DataMember]
        public PendingReason TicketPendingReason { get; set; }
    }
    

    This is why you probably want to set up a DTO layer, to avoid polluting your model classes.

    As for ExtensionData, it’s used for forward-compatibility: http://msdn.microsoft.com/en-us/library/ms731083.aspx

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

Sidebar

Related Questions

I'm not exactly new to PHP but I haven't used MySQL that much, so
I am new to Web/WCF/Services - so bear with me :) I am trying
I'm not new to version control, but am new to version control through the
I am not new to Wordpress, but new to PHP. I have managed to
I'm not new to Rails or Rspec, but I'm new to making gems. When
i have the WCF web service within my solution. service has interface which implemeted
We have a couple of .asmx soap web services that handle communication between our
I'm relatively new to webservices and C# but not to programing (lots of experience
When using web services (we're specifically using asmx and WCF) with ASP.NET, what is
I recently inherited a Silverlight web project that uses WCF services to handle asynchronous

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.