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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:30:09+00:00 2026-06-05T08:30:09+00:00

I have a webapi project mvc4 rc and a mvc4 rc web application deployed

  • 0

I have a webapi project mvc4 rc and a mvc4 rc web application deployed on a server.

Locally everything works correctly however on the server I get an error

2012-06-09 03:18:18,659 [23] INFO WebApplication.Controllers.AccountController – System.InvalidOperationException: No MediaTypeFormatter is available to read an object of type ‘Business’ from content with media type ”undefined”.
at System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent content, Type type, IEnumerable1 formatters, IFormatterLogger formatterLogger)
at System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent content, IEnumerable
1 formatters)
at WebApplication.Repository.BusinessRepository.GetByUserId(Guid userId) in C:\@Code\WebApplication\Repository\BusinessRepository.cs:line 37
at WebApplication.Controllers.AccountController.SignIn(LogOnModel model, String returnUrl) in C:\@Code\WebApplication\Controllers\AccountController.cs:line 61
.

My code that is trying to call the service looks like

 var url = ApiRestHelper.ApiUrl(ApiEndPointConstants.GetBusinessByUserId, "userId", userId.ToString());
 var service = ApiRestHelper.Get(url).Content;
 var data = service.ReadAsAsync<Business>().Result;
 HttpContext.Current.Session["BusinessInfo"] = data;
 return data;

 public static HttpResponseMessage Get(string apiMethod, string baseAddress)
    {
        var myHttpClient = new System.Net.Http.HttpClient
        {
            BaseAddress = new Uri(baseAddress)
        };
        var get = myHttpClient.GetAsync(apiMethod);
        var x = get.Result;
        return x;
    }

What am I doing wrong?

  • 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-05T08:30:11+00:00Added an answer on June 5, 2026 at 8:30 am

    This message indicates that you are trying to deserialize an instance of Business from a message that does not specify the Content-Type header. In such a case Web API does not know how to deserialize the message (it doesn’t know if it’s xml or json, for example). Are you sure that the service that is being called on the server is returning a correctly annotated message? (you can check the value of the service.Headers.ContentType property).

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

Sidebar

Related Questions

I have MVC webApi application which works with Unity . I have to resolve
I have an Eclipse Dynamic Web Project and a Tomcat server configured in Eclipse
I have a desktop webapi server that I want to expose to clients through
I've created a method using the new WebAPI features in MVC4 and have it
I have a multimodule web project with a dependency graph similar to this WAR-project
I have an ASP.NET WebApi project that utilizes Entity Framework 4.1. I am attempting
I have a project which consists of GWT client end and a Tomcat server
I have application that need from res folder with images. I deploy the project
I have the third party jar's in my WEB project placed at /src/main/webapp/WEB-INF/lib/ I
I have installed WCF Web API Preview 5 using NuGet Visual Studio extension (WebApi.All).

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.