views:

59

answers:

2

I have a self-hosted WCF REST application which is designed to accept and return JSON as a Stream with WebMessageBodyStyle.Bare. I am bypassing the DataContractSerializer using WebContentTypeMapper and WebContentFormat.Raw.

It works fine locally via WebHttpBinding, and also works fine when I use WebHttpRelayBinding and Content-Type: text/plain in Fiddler2, but whenever I use Content-Type: application/json I receive the following:

500TrackingId:e0281df8-12b4-4914-ab87-314956fb0df3, TimeStamp:07/27/2010 12:32:47

Is there any way of getting a WebHttpRelayBinding to accept Content-Type: application/json?

A: 

No. My references says that WebHttpBinding came about in support of xml and Json formart and REST Services.

Eduardo Xavier
A: 

What I was attempting to do was more along the lines of Port Bridge (http://blogs.msdn.com/b/clemensv/archive/2009/11/18/port-bridge.aspx) or SocketShifter (http://socketshifter.codeplex.com/) for the Windows Azure Service Bus. It just seemed to make more sense to make it part of my self-hosted WCF REST application if at all possible.

I've seen other questions on the Azure forums about using application/xml with WebMessageBodyStyle.Bare but they don't appear to have got much response either.

Solution Evangelist