Exemplo n.º 1
0
/*
 *                      protected override WebRequest GetWebRequest(Uri uri)
 *                      {
 *                              HttpWebRequest httpWebRequest = (HttpWebRequest)base.GetWebRequest(uri);
 *                              if (!string.IsNullOrEmpty(BearerToken))
 *                              {
 *                                      httpWebRequest.Headers.Add("Authorization", $"Bearer {BearerToken}");
 *                              }
 *                              WebRequestHelper.SetRequestHeaders(httpWebRequest, FormsAuthCookie, m_headers, m_cookies);
 *                              return httpWebRequest;
 *                      }
 *
 *                      protected override WebResponse GetWebResponse(WebRequest request)
 *                      {
 *                              using (new ServerImpersonationContext(m_impersonationUser))
 *                              {
 *                                      HttpWebResponse httpWebResponse = (HttpWebResponse)base.GetWebResponse(request);
 *                                      string text = httpWebResponse.Headers["RSAuthenticationHeader"];
 *                                      if (text != null)
 *                                      {
 *                                              Cookie cookie = httpWebResponse.Cookies[text];
 *                                              if (cookie != null)
 *                                              {
 *                                                      FormsAuthCookie = cookie;
 *                                              }
 *                                      }
 *                                      return httpWebResponse;
 *                              }
 *                      }
 */
            protected override void OnSoapException(FaultException e)
            {
                SoapVersionMismatchException.ThrowIfVersionMismatch(e, "ReportExecution2005.asmx", CommonStrings.UnsupportedReportServerError, includeInnerException: false);
                base.OnSoapException(e);
                throw ReportServerException.FromException(e);
            }