﻿To use:

1. Add the NewtonsoftJsonBehaviorExtension (must include the Assembly name)
2. Add the NewtonsoftJsonContentTypeMapper ContentTypeMapper to the WebHttpBinding (must include the Assembly name)
3. Add the NewtonsoftJsonBehavior to the EndpointBehavior
4. Set up the JSON endpoint as normal.
5. (Optional, but highly desired) Ensure all operations have WebRequestBody Bare or at least only WrappedRequest to avoid the need to handle unwrapping responses on the client.

Example:
<system.ServiceModel>

	<extensions>
	  <behaviorExtensions>
		<add name="newtonsoftWebHttp" type="Curse.CloudServices.Wcf.Json.NewtonsoftJsonBehaviorExtension, Curse.CloudServices.Wcf.Json"/>
	  </behaviorExtensions>
	</extensions>

	<bindings>
	  <webHttpBinding>
		<binding name="mappedBinding" contentTypeMapper="Curse.CloudServices.Wcf.Json.NewtonsoftJsonContentTypeMapper, Curse.CloudServices.Wcf.Json"/>
	  </webHttpBinding>
	</bindings>

	<behaviors>
	  <endpointBehaviors>
		<behavior name="newtonsoftBehavior">
		  <newtonsoftWebHttp HelpEnabled="true" FaultExceptionEnabled="true"/>
		</behavior>
	  </endpointBehaviors>
	</behaviors>

	<services>
	  <service name="Curse.ExampleService">
		<endpoint address="json" behaviorConfiguration="newtonsoftBehavior" binding="webHttpBinding" bindingConfiguration="mappedBinding" contract="Curse.IExampleService"/>
		...
	  </service>
	</services>

</system.ServiceModel>