Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have several WCF services that i want to host on an IIS 7 machine. My clients will POST data to these services in JSON format. Because of this, I will set the Content-Type of my Request to "application/json" as shown here:

serviceProxy.Headers["Content-Type"] = "application/json";
serviceProxy.Encoding = System.Text.Encoding.UTF8;
serviceProxy.UploadStringAsync(uri, "POST", "[jsondata]");

How do I ensure that "application/json" content type is supported in my environment? I've noticed that this service works if I change the Content-Type to "application/x-www-form-urlencoded". This leads me to believe that I need to setup support for "application/json" in IIS, but I'm not sure what I need to do.

Can someone please help me out?

Thanks!

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

make sure the proper version of the framework is running in the application pool. I believe this requires framework 4.0 WCF

share|improve this answer
add comment

To add a MIME type to IIS:

  1. In IIS Manager
  2. Go to the server level
  3. In the IIS group, double-click the MIME Types icon.
  4. In the Actions area, click Add and fill in the dialog.

In your case though, this may not be a required step--I'm not sure. It is possible that you don't have the WCF framework installed or configured correctly on the server. Check your logs for any errors and please update the question with any relevant entries.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.