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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:13:05+00:00 2026-06-14T02:13:05+00:00

Currently I am faced with the requirement building an web service that will let

  • 0

Currently I am faced with the requirement building an web service that will let a java client retrieve and trigger actions on our data through httprequest. We are a .Net shop it appears the latest solution for this is Microsoft’s MVC4 Web API. I am used to your standard tiered architecture I have pulled data from API’s but this will be my first web service supplying data.

From my studies I have seen suggestions as follows:

  • Separating the logic and data access into a separate project type class library.
  • Using your Controls to access data and perform logic.
  • Using your Model to access data and perform logic.

I am looking for someone who has experience with MVC4 Web API who can shed some light on good practices for building a web service in this way.

Thanks in advance.

  • 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-14T02:13:06+00:00Added an answer on June 14, 2026 at 2:13 am

    First of all, do put your ASP.NET Web API logic into a separate project. This will give you flexibility over hosting layer (as ASP.NET Web API is hosting agnostic) and it just makes the whole project clean. Let’s say your project’s name is MyProject. You can name the API project as MyProject.API and you can install the Microsoft.AspNet.WebApi.Core NuGet package into this project.

    I also suggest you to separate your domain layer as well (POCO entities, repositories, your service layer pieces, etc.). Let’s call this MyProject.Domain. Then, you would reference this MyProject.Domain project from the MyProject.APIproject.

    I wouldn’t recommend you to dump all your POCO entities into your API. So, I would definately work with Data Transfer Objects (Dto). You can use a 3rd party tool like autoMapper to map your entity classes to your Dtos. However, do put your Dtos, Request Commands, Request Models into a separate project. You would reference MyProject.API.Model project from MyProject.API project. Why do we create a separate project for this? Because, later if you decide to build a .NET client wrapper for your HTTP API, you can easily reference this project to use those with your .NET client as well. Let’s call this project MyProject.API.Model.

    Lastly, we need a hosting layer for our API. Asumming that you would like to host this project under ASP.NET, you can create a new project through the Empty Web Application template and let’s call this project MyProject.API.WebHost. Then, you can install the Microsoft.AspNet.WebApi package into this project. From this project, you would reference MyProject.API, MyProject.API.Model and MyProject.Domain projects. This project is the one that you should deploy to your server.

    If you would like to create a .NET wrapper for your HTTP API, you can create another project called MyProject.API.Client and install Microsoft.AspNet.WebApi.Client package into this one. You would also reference the MyProject.API.Model project from this one so that you can deserialize into and serialize from strongly-typed objects.

    Here is the screenshot of the solution explorer for the project I have been working with:

    enter image description here

    Hope this gives you a bit of an idea.

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

Sidebar

Related Questions

I'm currently faced with a dilemma. I'm trying to build a menu that will
Currently im faced with the following problem: I have a script that searches through
I'm faced with a task to make our software stack scalable. It's currently not
I am faced with a style difficulty, I am currently building a site with
Currently, I'm using CodeIgniter framework for my web applications and I have faced one
I am currently developing a database system for a school that will work with
I'm refactoring a library we currently use, and I'm faced with the following problem.
I am currently looking in to some file uploading using Java Server Faces. I've
I am currently developing for android and using some face recognition services. The service
Currently, I am writing a MiddleWare application that synchronizes information between and accounting application

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.