/*
 *                      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);
            }
예제 #2
0
 public static ReportServerException ExceptionFromWebResponse(Exception e)
 {
     return(ReportServerException.FromException(ExceptionFromWebResponseUnwrapped(e)));
 }