title: WCF Rest Client sending incorrect content-type
body: <p>I am trying to send a request using a wcf client to a ColdFusion 9 service using json.  However, the content-type of the request is for xml.</p>
  
  <p>Here is the service contract.  As you can see we specificy using RequestFormat of json.</p>
  
  <pre><code>[ServiceContract(Name = "ServiceAgreementRequestService", Namespace = NetworkNamespaces.ServiceNamespace)]
  public interface IServiceAgreementRequestService
  {
  [OperationContract]
  [FaultContract(typeof(RequestFault))]
  [WebInvoke(UriTemplate = "?method=CreateUser", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
  CreateUserResponse CreateUser(CreateUserRequest request);
  }
  </code></pre>
  
  <p>I have also tried to set the Request.ContentType on the OutGoing request and this also did not work.</p>
  
  <pre><code>using (var context = this.GetServiceClient(clientId))
  {
  WebOperationContext.Current.OutgoingRequest.ContentType = "application/json; charset=UTF-8";
  var request = new CreateUserRequest(user.Id, user.Person.FirstName, user.Person.LastName);
  var response = context.Channel.CreateUser(request);
  }
  </code></pre>
  
  <p>Here is the request that gets sent</p>
  
  <pre><code>POST http://somesite.domain.com/WebServices/ProviderService.cfc/?method=CreateUser HTTP/1.1
  Content-Type: application/xml; charset=utf-8
  VsDebuggerCausalityData: uIDPo7eh9U9jsBVLqVgGtqTK+eMBAAAAb++0xkOSQEmcAKZLgQEsp2/muY2ca6NJiul6pkAaWZwACQAA
  Host: somehost.domain.com
  Content-Length: 58
  Expect: 100-continue
  Accept-Encoding: gzip, deflate
  
  {"UserId":4,"FirstName":"FirstName","LastName":"LastName"}
  </code></pre>
  
  <p>How do I get this to use the correct content-type?</p>
  
  <p>EDIT: </p>
  
  <p>Under the hood, the GetServiceClient(clientId) call uses system.servicemodel.clientbase and ChannelFactory to create the communication channel.  The endpoint that we call out to changes by client so we have some code on top of those to dynamically change out the endpoint.</p>
  
  <p>Some more info.  We have two applications : One is a .net MVC 4 web application to host the client app and one is a .net WCF Server application to host the backend services.  I can call out to the ColdFusion app successfully from the web application, but not the wcf Server application.  These both use the same code base to make the outgoing call.</p>
  
  <p>As far as I can tell the config is the same for both.</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;endpointBehaviors&gt;
  &lt;behavior name="WcfRestBehavior"&gt;
  &lt;webHttp /&gt;
  &lt;/behavior&gt;
  
  &lt;client&gt;
  &lt;endpoint name="ServiceAgreementRequestService" address="http://PLACEHOLDER/" binding="webHttpBinding" behaviorConfiguration="WcfRestBehavior" contract="IServiceAgreementRequestService"/&gt;
  </code></pre>