tags:

views:

29

answers:

1

This is related the following question, but I thought I would create another post so that question would not become too convoluted:

When I changed the ResponseFormat to XML, the browser return the response correctly, but if I try to use JSON as the ResponseFormat, it asks me if I want to download the file. Just to see what is in the file, I downloaded it and it contains the response in plain text json format. Is there some configuration I am missing?

A: 

It probably has to do with the MIME type in the JSON http response not being set to something your browser "thinks" it should open right in the page.

What is your WebMessageBodyStyle set to in your WebGet attribute?

See http://msdn.microsoft.com/en-us/library/system.servicemodel.web.webgetattribute.aspx

JeffN825
The WebMessageFormat is JSON and this is when it asks me to download the file. If I leave it as XML, it displays in the browser.
Xaisoft
I'm asking about the WebMessageBodyStyle, not the WebMessageFormat.
JeffN825