title: WCF wont accept JSON request
body: <p>I have this code submitted to the server:</p>
  
  <pre><code>var obj = { "param": { "WithdrawalRequestId": window.Xrm.Page.data.entity.getId()} };
      $.ajax({
          type: "POST",
          dataType: "json",   
          data: JSON.stringify(obj),
  
          url: crmConfig.service + '/WithdrawRequestService.svc/ExecuteWithdrawalRequests/',
  
      });
  </code></pre>
  
  <p>the actual content that went to the server is:</p>
  
  <pre><code>{"param":{"WithdrawalRequestId":"{628E2E3A-283A-E311-B658-005056B7032A}"}}
  </code></pre>
  
  <p>The interface: </p>
  
  <pre><code> [OperationContract]
          [WebInvoke(Method = "POST",
              RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Wrapped,
              UriTemplate = "/ExecuteWithdrawalRequests/")]
          void ExecuteWithdrawalRequests(GuidParameter param);
  </code></pre>
  
  <p>The GuidParameter class:</p>
  
  <pre><code>[DataContract]
  public class GuidParameter
  {
      [DataMember]
      public Guid WithdrawalRequestId { get; set; }
  
  }
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>The server encountered an error processing the request. 
  </code></pre>
  
  <p>The exception message is 'The incoming message has an unexpected message format 'Raw'.<br>
   The expected message formats for the operation are 'Xml', 'Json'. This can be because a WebContentTypeMapper has not been configured on the binding.<br>
  See the documentation of WebContentTypeMapper for more details.</p>
  
  <p>And this is the chrome output:</p>
  
  <pre><code>`Request URL:http://crm3:81/WithdrawRequestService.svc/ExecuteWithdrawalRequests/
  Request Method:POST
  Status Code:500 General Error. Please contact support team.
  Request Headersview source
  Accept:application/json, text/javascript, */*
  Accept-Encoding:gzip,deflate,sdch
  Accept-Language:en-US,en;q=0.8
  Cache-Control:no-cache
  Connection:keep-alive
  Content-Length:74
  Content-Type:application/x-www-form-urlencoded
  Host:crm3:81
  Origin:http://crm3
  Pragma:no-cache
  Referer:http://crm3/CRN/userdefined/edit.aspx?_gridType=10019&amp;etc=10019&amp;id=%7b628E2E3A-283A-E311-B658-005056B7032A%7d&amp;pagemode=iframe&amp;rskey=292691624
  User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36
  Form Dataview sourceview URL encoded
  {"param":{"WithdrawalRequestId":"{628E2E3A-283A-E311-B658-005056B7032A}"}}:
  Response Headersview source
  Access-Control-Allow-Headers:Content-Type, Accept
  Access-Control-Allow-Methods:POST
  Access-Control-Allow-Origin:*
  Cache-Control:private
  Content-Length:2738
  Content-Type:text/html
  Date:Mon, 28 Oct 2013 07:35:33 GMT
  Server:Microsoft-IIS/7.5
  X-AspNet-Version:4.0.30319
  X-Powered-By:ASP.NET`
  </code></pre>