Ulazak SSRS Web usluge iz WSS / Mahovina u FBA okoliša

Mi je potrebno da se pozove na "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: Nije ovlaštena
  • Objekt Moved

"Objekt preselio" Poruka je najzanimljivije jer je rekao da "objekt" (naš SSRS usluga) je "preselio" to login.aspx. This clearly meant we had some kind of authentication problem.

Na kraju sam shvatila da sam imala označili blogu 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 (od 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".

Evo kod koji je radio za nas:

ReportingService2006 rs = nula; 
// Dokazati Provjera auth = novi Ovjera(); 
auth.Url = "http://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
novi CookieContainer();
LoginResult rezultat = auth.Login("userid", "password");
ako (result.ErrorCode == LoginErrorCode.NoError) 
{
// Bez pogreške, tako dobiti kolačiće.
CookieCollection kolačiće = auth.CookieContainer.GetCookies(novi Uri(auth.Url));
Cookie authCookie = kolačići[result.CookieName];
rs =
novi ReportingService2006();
rs.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
novi CookieContainer();
rs.CookieContainer.Add(authCookie);
}
pokušati
{
  rs.CreateSubscription(izvijestiti, extSettings, Opis, eventType, matchData, parameters1);
}
ulov (Iznimka ex)
{
  Console.WriteLine(ex.Message.ToString());
}

Ja interpretirati stvari raditi kao što je to:

  • Naša web-dio treba dial-up uslugu provjere autentičnosti i reći, "Hey, Tony, to sam ja!".
  • Autentifikacije usluga odgovora rekavši, "Hey, I know you. How are the kids? Here’s a token."
  • Zovemo se SSR uslugu i reći, "Tony sent me, evo token."

</kraj>

Pretplatite se na moj blog.

Technorati Tags: , ,

Dopust jedan Odgovor

Vaša email adresa neće biti objavljena. obavezna polja su označena *