Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'sams microsoft sql server 2008- p11', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Using Reporting Services Web Services 481 static string GetReportXML_VS2008 string ReportPath creates a new web service proxy and sets its credentials ReportExecutionServiceSoapClient rs new ReportExecutionServiceSoapClient Windows authentication rs.ClientCredentials.Windows.AllowedImpersonationLevel System.Security.Principal.TokenImpersonationLevel.Impersonation Setup Render call byte result null string encoding mimeType extension DeviceInfo null Warning warnings null string streamIDs null try string historyID null ExecutionInfo ExecInfo ExecutionHeader ExecHeader ServerInfoHeader SvrInfoHeader Note set TrustedUserHeader null this is undocumented structure ExecHeader rs.LoadReport null ReportPath historyID out SvrInfoHeader out ExecInfo rs.Render ExecHeader null XML DeviceInfo out result out extension out mimeType out encoding out warnings out streamIDs Gets a byte stream with Comma Separated Value XML layout return System.Text.Encoding.ASCII.GetString result catch SoapException e Return exception message if exception occurred return e.Message Before we can use the preceding code we must sort out security. Notice the following lines in the code 28 lease purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 482 CHAPTER 28 Using Reporting Services Web Services rs.ClientCredentials.Windows.AllowedImpersonationLevel System.Security.Principal.TokenImpersonationLevel.Impersonation It is a request to WCF to impersonate the user. In addition to the code we need to properly configure security in the app.config file. You can find the app.config file in your project s folder. Double-click it to edit and ensure that it has the following in the security section. Note that most of the security section is already set and you just need to fill missing items such as clientCredentialType. security mode TransportCredentialOnly transport clientCredentialType Windows proxyCredentialType None realm message clientCredentialType UserName algorithmSuite Default security .