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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:36:41+00:00 2026-05-21T23:36:41+00:00

I have a WCF Service, behind the WCF service is a Service layer (

  • 0

I have a WCF Service, behind the WCF service is a Service layer (http://martinfowler.com/eaaCatalog/serviceLayer.html) and repository layer.

So a client calls the WCF Service layer and the WCF Service layer (acting as a service layer) calls the repository layer.

The repository layer returns MODELS (POCOs) which represent the Database. Then the service layer I presume I need to convert the POCOs to DTO to transfer over the wire? Or should I just leave these as POCOs?

Once I have my given object on the service layer I return this to the client (ASP.NET MVC) whose controller is responsible for mapping the object returned from the WCF Service into a VIEWMODEL.

I want to know I am doing this right i.e. Service layer and Repository layer behind WCF Service?

And controller in charge of creating a ViewModel from the actual model that is returned from the WCF Service.

Also I wonder if it’s really necessary to convert from the REAL models that the Repository would return to DTOs ready from returning from the WCF Service.

  • 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-21T23:36:42+00:00Added an answer on May 21, 2026 at 11:36 pm

    As far as your WCF service is concerned everything looks fine. You have models, a repository layer to access the data and you are returning those models to the clients. Whether you should use DTOs is debatable. If you have POCOs (not some ORM dependent objects) you should be fine. Although there are cases where DTOs might be required: for example circular object graphs which can be managed fine by the ORM but cannot be serialized over the wire (in an interoperable way).

    Now to the client part: the fact that you are using WCF should be an implementation detail. So in your ASP.NET MVC application you would have a repository working with the POCOs you have imported when you svcutil.exeed your service and then an implementation of this repository which will perform the actual call to the service (probably using the ServiceClient autogenerated class). Then your controllers should work with the abstract repository and have the DI framework configured to inject the actual implementation. When a controller action calls some repository method it gets a POCO which will then by handled to the mapping layer (AutoMapper?) for conversion into a specific view model passed to the view. And the other way around: a controller action gets a view model from the view as action parameter, uses the mapping layer to map it back to a POCO which will passed to a repository which will take the responsibility of performing the required task with this model (in your case and the specific implementation that would be passing it to some remote WCF service).

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

Sidebar

Related Questions

I have a simple WCF service that I call server side from code behind
I have a WCF service running behind a Microsoft Forefront/TMG. The service is on
Say I have a web project which uses a WCF service for behind-the-scenes processing,
I have a WCF service hosted on a server. A client application is accessing
We have a WCF service hosted on IIS behind a SiteMinder proxy (for lack
We have a WCF service ( NetTcpBinding ) that sits behind a load balancer.
I have a WCF service that provides access to some data. Our client has
I have a WCF service and a client that uses that service. They use
I'm new here and I hope anyonte can help me. I have WCF Service
I have a WCF service that accesses a SQL database to fetch data .

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.