Monday, March 26, 2012

Forms Authentication : Object moved

Oops!
Sorry I don't know why I sent that without a question :-)
Basically, I've implimented the Forms Authentication sample, and now
the following code causes the error above.
ReportingService rs = new ReportingService();
rs.LogonUser("UserWithBlankPassword",String.Empty, null);
BatchHeader BH = new BatchHeader();
BH.BatchID = rs.CreateBatch();
rs.BatchHeaderValue = BH;
ScheduleDefinition SD = new ScheduleDefinition();
SD = ((ScheduleDefinition)S.ScheduleDefinition);
string scheduleid = rs.CreateSchedule(R.ReportId.ToString() + "_" +
EBCUserId.ToString(),SD);
rs.ExecuteBatch();
Anyone got any ideas?
Thanks,
Phil Winstanley
Microsoft ASP.NET MVPPhil,
It may be because the authentication ticket (sqlAuthCookie) is not passed to
the Report Server. The successful output of the LogonUser call is an
in-session cookie sent to the browser (just like ASP.NET Forms
Authentication). I think what is happening in your case is that you are
generating the cookie on the same page on which you are trying to pass it
back. Do a tcp trace to find out if the cookie is sent to the Report Server.
If not, you may need to move the subsequent SOAP calls to another page after
a redirect.
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote in
message news:cffcgk$ol3@.odak26.prod.google.com...
> Oops!
> Sorry I don't know why I sent that without a question :-)
> Basically, I've implimented the Forms Authentication sample, and now
> the following code causes the error above.
> ReportingService rs = new ReportingService();
> rs.LogonUser("UserWithBlankPassword",String.Empty, null);
> BatchHeader BH = new BatchHeader();
> BH.BatchID = rs.CreateBatch();
> rs.BatchHeaderValue = BH;
> ScheduleDefinition SD = new ScheduleDefinition();
> SD = ((ScheduleDefinition)S.ScheduleDefinition);
> string scheduleid = rs.CreateSchedule(R.ReportId.ToString() + "_" +
> EBCUserId.ToString(),SD);
> rs.ExecuteBatch();
> Anyone got any ideas?
> Thanks,
> Phil Winstanley
> Microsoft ASP.NET MVP
>

No comments:

Post a Comment