Monday, March 26, 2012

Reporting Services 2000 w/ Forms Auth - rs.Timeout not getting set

I have implemented the Forms Authentication in Reporting Services 2000. In addition, we have a reports web application that uses the authentication to access the reports in the Reports Server. I have implemented a similar code that is posted in http://msdn2.microsoft.com/en-us/library/aa902691(SQL.80).aspxhttp://msdn2.microsoft.com/en-us/library/aa902691(SQL.80).aspx for the Reports Server and Reports Manager. For the web application, I added reference to the custom security assembly, created a new ReportsServerProxy, andthen called the LogonUser().

Now, one of the functionality we have in the applicaiton istoset the reporting services Timeout for reports that take too longto run. The weird thing is the Timeout (in milliseconds) is getting ignored by the ReportServerProxy using the custom security assembly. I verified that without the custom secuirty assembly, the Timeout propertyis getting set.

I did find the code for ReportServerProxy's GetWebRequest(Uri uri) is setting the request.Timeout to -1. I thought this was interfering with the rs.Timeout, but removing the code did not make any difference.

How do I set the Timeout property correctly? Do you know of any issues with setting the Timeout propertyfor Reporting Services with Forms Authentication?

Can anybody help PLEASE? I need an answer ASAP. Thanks in advance for your help.

/**partial UILogon.aspx code for ReportServerProxy below**/

publicclass ReportServerProxy : ReportingService

{

protected override WebRequest GetWebRequest(Uri uri)

{

HttpWebRequest request;

request = (HttpWebRequest)HttpWebRequest.Create(uri);

// Create a cookie jar to hold the request cookie

CookieContainer cookieJar = new CookieContainer();

request.CookieContainer = cookieJar;

Cookie authCookie = AuthCookie;

// if the client already has an auth cookie

// place it in the request's cookie container

if (authCookie != null)

request.CookieContainer.Add(authCookie);

request.Timeout = -1;

request.Headers.Add("Accept-Language",

HttpContext.Current.Request.Headers["Accept-Language"]);

return request;

} ...}

/** Below is the Reports Web applicaiton code that calls the ReportsServerProxy LogonUser **/

PublicFunction GetReportServerProxy() As ReportServerProxy

Dim rsProx AsNew ReportServerProxy

rsProx.Url = ConfigurationSettings.AppSettings("REPORT_SERVER_URL") + "/ReportService.asmx"

Try

rsProx.LogonUser("SYSADMIN", "password", Nothing)

Return rsProx

Catch ex As Exception

Throw New Exception("GetReportServerProxy Failed.", ex)

End Try

EndFunction

PrivateFunction CreateSnapShot() AsString

...

Dim rs As RSCustomSecurity.ReportServerProxy

Try

rs = GetReportServerProxy()

' First set the parameters' default values

parameters = setParamters()

rs.SetReportParameters(reportPath, parameters)

If errorsList.Count > 0 Then Throw New Exception

'Server.ScriptTimeout = 10

rs.Timeout = Integer.Parse(ConfigurationSettings.AppSettings.Get("REPORT_PROCESS_TIMEOUT"))

lsHistoryID = rs.CreateReportHistorySnapshot(reportPath, warnings)

'lblStatus.NavigateUrl = "ViewSnapShot.aspx?History_ID=" & lsHistoryID

lblStatus.Text = "Your request has been processed. View report as"

....

Catch ex As Exception

....

Finally

Debug.Write("End : " & Now.ToLongTimeString)

rs = Nothing

End Try

EndFunction

Anyone that has any idea, PLEASE respond. Just to reiterate...

I have implemented the forms authentication for Reporting Services 2000. Below, I set the ReportingServices.Timeout property and then call CreateReportHistory(). Before I implemented the Forms Authentication, the timeout was getting recognized, which means the CreateReportHistorySnapshot errors out with a message "Operation timed out". But now, with Forms Authentication, the Timeout is not recognized and CreateReportHistory runs until it finishes generating the report, which can take a while to run. Does anyone know what I need to do to set it correctly?

rs.Timeout = Integer.Parse(ConfigurationSettings.AppSettings.Get("REPORT_PROCESS_TIMEOUT"))

lsHistoryID = rs.CreateReportHistorySnapshot(reportPath, warnings)

Thanks!

sql

No comments:

Post a Comment