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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:41:34+00:00 2026-06-02T19:41:34+00:00

I’m trying to expose a fairly complicated class library as a service, I think

  • 0

I’m trying to expose a fairly complicated class library as a service, I think WCF, but am pretty green and am struggling to understand what I can and cannot do architecturally. If my clients are to be .NET as well (let’s say WinForms, WPF, and/or ASP.NET MVC3), it seems like overkill to write a bunch of contracts to re-expose public classes, or to serialize complex objects. It’s hard to know from the many tutorials out there, because so many of them only work with value/primitive types.

Is WCF the way to go? If so, which flavor is the simplest to implement if the class library will manage all aspects of data and expose only objects?

A simple analogy: a HumanBody class that needed to be exposed as a service allowing for multiple users, always on, etc. If I have a .NET Applause client, and I want to do something like

ServiceName.HumanBody myBody = new HumanBody();
myBody.Parts.Hands.Clap();  

I’d have to turn those objects into interfaces and write a bunch of wrapper methods, but the objects are “complete” as they exist–this is why it feels like overkill to me. (I know I’m not thinking about this correctly–that’s the reason for the question. If these questions are too vague, I will refine on comment/answer.)

(Also, please note that I am not asking how to accomplish this practically–there are many versions of that question already on SO, with a couple notable good answers here and here. There’s also a very useful tutorial on how to build your own WCF architecture without the VS auto-added clutter here. I am working through the construction on my own.)

  • 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-02T19:41:36+00:00Added an answer on June 2, 2026 at 7:41 pm

    WCF is most likely the best route for you. However, before you start thinking about how to approach it, I think we need to clarify what a service is just a bit.

    A service, regardless of the transport layer that it uses (HTTP, HTTPS, TCP, UDP, MSMQ, carrier pidgeons, etc.) is just a list of operations that take parameters. You cannot, per-se, expose your “HumanBody” class as a service as it is. Services are not object-oriented; they’re very much like procedural programming.

    You can, of course, send over complex object graphs as parameters or return them as the return value of a service operation. You can also write your client library in such a way that your interface to the service is object oriented, but your actual service commands will not be that way.

    To use your above example, you’d have this as a service interface:

    public interface IHumanBodyService
    {
        ClapHands(<parameters>);
    }
    

    <parameters> here would be whatever identifying information is necessary to send to the service so that it can know what to do. That might be the whole myBody object graph (serialized, of course, but WCF will take care of that for you as long as your class is properly annotated), or it might be something as simple as a BodyId or PersonId value.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.