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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:17:07+00:00 2026-05-26T04:17:07+00:00

Facing an interesting issue when I am using WCF Web API with Hammock and

  • 0

Facing an interesting issue when I am using WCF Web API with Hammock and WP7. As you know, WCF Web API allows you to change the response type based on what you specify in the Accept header. For e.g. if you send Accept:application/json, the response is JSON, if you specify application/xml you get XML and so on.

So I created my Web API which works perfectly fine from a Web Browser. As expected I get the types I want. Hwoever, when I use this from WP7, it doesn’t matter what the Accept header is, it looks like WP7 replaces it to / and I only get back XML.

I know for a fact that it isn’t Hammock that is the issue because I tried with Facebook Graph API. If I change the Accept to say: application/hello, I get a bad request error. However, when I do that with WP7 in C# code, I get absolutely no errors and the return type is XML irrespective of what I send.

To circumvent this issue, I created a JSON.Net Serializer in my WCF Web API. Everything worked great until I started using HttpResponseMessage in my methods as return types. Now even though i have a JSON serializer, I get XML for all methods where I use the HttpResponseMessage.

As you can see, I am in lala land now.

Can anyone provide any feedback?

Any help is highly appreciated.

  • 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-26T04:17:08+00:00Added an answer on May 26, 2026 at 4:17 am

    I ran into this and posted this issue on CodePlex. It’s been fixed if you pull the latest source, although Nuget hasn’t been updated yet. You should then be able to remove the xml formatter or clear the built in formatters and add the one you want. Another workaround that I found was to clear the built in formatters and create a custom media type formatter that mapped to / accept type.

    Update: this has been fixed with WCF Web API Preview 6 now on nuget.

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

Sidebar

Related Questions

We are facing one issue directly connected with our Flash API we've given to
I am facing an interesting problem right now. I know it is not that
I am using C# for my programming. I am facing issue, that my hidden
The issue I am facing is an interesting one and my knowledge of security
I am facing problem with an Oracle Query in a .net 2.0 based windows
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing
Im facing a bit of an issue when trying to validate a decimal property
Im facing a strange issue trying to move from sql server to oracle. in
this is a hard question. I've found nothing interesting over the web. I'm developing
I am facing an interesting problem while working on Google Map Page. Actually I

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.