title: WCF How to Return Byte Array in post method and read the byte content to open as pdf
body: <p>WCF Service:</p>
  
  <pre><code>public byte[] GetEsignContent(string LoanID)
      {
  
          string strConnection;
          strConnection = ConfigurationManager.AppSettings["SqlConn"];
          WMSQLCon.DBSettings.ConnectionString = strConnection;
  
          byte[] bDocContent;
          IAppUsers.GetDocContent(Convert.ToInt32(LoanID), out bDocContent);
          return bDocContent;
  
      }
  </code></pre>
  
  <p>Client APplication(aspx)</p>
  
  <pre><code> int LoanID = Convert.ToInt32(Request.QueryString["LoanID"]);
              string URL = "http://PS30/IAPPService/IApp.svc/IApp/GetEsignDocument/" + LoanID.ToString(); ;
              HttpWebRequest hwrProg = (HttpWebRequest)WebRequest.Create(URL);
              HttpWebResponse hwrpProg = (HttpWebResponse)hwrProg.GetResponse();
              StreamReader sr = new StreamReader(hwrpProg.GetResponseStream(), Encoding.ASCII);
             // string str = sr.ReadToEnd();
             // byte[] bcontent = Convert.FromBase64String(sr.ReadToEnd());
             //byte[] bcontent = Encoding.ASCII.GetBytes(sr.ReadToEnd());  
              Response.ContentType = "Application/pdf";
              Page.Response.AddHeader("Content-Disposition", "inline;filename=xxx.pdf");
              Response.AddHeader("content-length", bcontent.Length.ToString());
              Response.BinaryWrite(bcontent);
              Response.Flush();
              Response.Close();
              sr.Close();
  </code></pre>
  
  <p>I am not able get exact binary which get in service in the bcontent of client application..please help me...</p>