WCF サービス:
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;
}
クライアント アプリケーション (aspx)
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();
クライアント アプリケーションの bcontent でサービスを開始する正確なバイナリを取得できません。助けてください...