title: Restful wcf Service error 'Unable to deserialize XML body with root name
body: <p>I have written a  RESFful service for a phone app.
  I am not sure what am I doing wrong? I tried to test it with multiple content type settings but no luck.
  The data from a phone app is coming encoded in following format.
  PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiPjxzYW1scDpTdGF0dXM+PHNhbWxwOlN0YXR1c0NvZGU+ aGVyVmFsdWU+PC94ZW5jOkNpcGhlckRhdGE+PC94ZW5jOkVuY3J5cHRlZERhdGE+PC9zYW1sOkVuY3J5cHRlZEFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg==";</p>
  
  <p>This is the definition in the interface:</p>
  
  <pre><code>[OperationContract]
      [WebInvoke]
      String GetUserInfo(String authenticateRequest);
  </code></pre>
  
  <p>I get error:  with following  test code.</p>
  
  <p>'Unable to deserialize XML body with root name 'Binary' and root namespace '' (for operation 'GetMobileCheckCapture' and contract ('IMobileCC',  'http://tempuri.org/')) using DataContractSerializer</p>
  
  <p>This is how I am trying to test the service:
  String encryptedSAML = </p>
  
  <p>PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiPjxzYW1scDpTdGF0dXM+PHNhbWxwOlN0YXR1c0NvZGU+ aGVyVmFsdWU+PC94ZW5jOkNpcGhlckRhdGE+PC94ZW5jOkVuY3J5cHRlZERhdGE+PC9zYW1sOkVuY3J5cHRlZEFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg==";</p>
  
  <pre><code> HttpWebRequest req = WebRequest.Create("http://localhost/Services/Mservice.svc/GetUserInfo") as HttpWebRequest;
              req.KeepAlive = false;
              req.Method = "POST";
              req.ContentType = "text/xml; encoding='utf-8'";
                ASCIIEncoding encoding = new ASCIIEncoding();
              byte[] bDataToPass = encoding.GetBytes(encryptedSAML);
              req.ContentLength = bDataToPass.Length;
  
          using (Stream dataStream = req.GetRequestStream())
          {
              dataStream.Write(bDataToPass, 0, bDataToPass.Length);
          }
  
          try
          {
              using (WebResponse webresponse = req.GetResponse())
              {
                  StreamReader reader = null;
                  string responses = "";
  
                  string StatusDescription = ((HttpWebResponse)webresponse).StatusDescription;
  
                  if (((HttpWebResponse)webresponse).StatusCode != HttpStatusCode.OK)
                  {
                      // Console.Write();
                  }
                  reader = new StreamReader(webresponse.GetResponseStream());
                  responses = reader.ReadToEnd();
                  XmlDocument xmldoc = new XmlDocument();
                  xmldoc.LoadXml(responses.Replace("&amp;", "&amp;amp;"));
                  response = xmldoc;
              }
          }
          catch (WebException e)
          {
              using (WebResponse response2 = e.Response)
              {
                  HttpWebResponse httpResponse = (HttpWebResponse)response2;
                  Console.WriteLine("Error code: {0}", httpResponse.StatusCode);
                  using (Stream data = response2.GetResponseStream())
                  {
                      string text = new StreamReader(data).ReadToEnd();
                      Console.WriteLine(text);
                  }
              }
          } 
  </code></pre>