Kuliungama Huduma Mtandao SSRS Kutoka WSS / MOSS katika Mazingira FBA

We needed to invoke the "CreateSubscription" method on an SSRS web service that is hosted in an FBA managed MOSS environment from a custom web part. We kept getting variations of:

  • 401: Hana mamlaka ya
  • Kitu Moved

The "object moved" message was most interesting because it was saying that the "object" (yetu SSRS huduma) had "moved" to login.aspx. This clearly meant we had some kind of authentication problem.

I eventually realized that I had bookmarked a blog entry by Robert Garret that described how to invoke a general purpose WSS/MOSS web service living inside an FBA environment. Note that I can’t link directly to the article (kama ya 06/09/08) because it wants to authenticate. The link I provide brings you to an "all posts" view and you can locate the specific article by searching for "Accessing MOSS Web Services using Forms Based Authentication".

Here’s the code that worked for us:

ReportingService2006 rs = null; 
// Authenticate Authentication auth = mpya Authentication(); 
auth.Url = "http://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
mpya CookieContainer();
LoginResult matokeo = auth.Login("userid", "password");
kama (result.ErrorCode == LoginErrorCode.NoError) 
{
// Hakuna makosa, hivyo kupata biskuti.
CookieCollection cookies = auth.CookieContainer.GetCookies(mpya Uri(auth.Url));
Kuki authCookie = kuki[result.CookieName];
rs =
mpya ReportingService2006();
rs.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
mpya CookieContainer();
rs.CookieContainer.Add(authCookie);
}
kujaribu
{
  rs.CreateSubscription(kuripoti, extSettings, desc, eventType, matchData, parameters1);
}
kukamata (Ubaguzi wa zamani)
{
  Console.WriteLine(ex.Message.ToString());
}

Mimi kutafsiri mambo ya kufanya kazi kama hii:

  • Mtandao wetu sehemu inahitaji piga juu ya huduma ya kujitambulisha na kusema, "Hey, Tony, ni mimi!".
  • Uthibitishaji huduma majibu akisema, "Hey, I know you. How are the kids? Here’s a token."
  • Tunatoa wito up huduma SSRS na kusema, "Tony sent me, hapa ni ishara."

</mwisho>

Kujiunga na blog yangu.

Kuondoka Reply

Anwani yako si kuchapishwa. Mashamba required ni alama *