Zerbitzuak SSRS Web deitzean WSS From / FBA Ingurumena MOSS

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: Baimenik ez
  • Objektua lekuz aldatu

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

Izan dut azkenean konturatu I laster blog-sarrera 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 (gisa 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".

Hona hemen kodea Gurekin lan egin:

ReportingService2006 RS = zero; 
// Autentifikatu Autentifikazio auth = berria Autentifikazio(); 
auth.Url = "http://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
berria CookieContainer();
LoginResult emaitza = auth.Login("userid", "password");
bada (result.ErrorCode == LoginErrorCode.NoError) 
{
// Error No, beraz, lortu cookies.
CookieCollection cookies = auth.CookieContainer.GetCookies(berria Uri(auth.Url));
Cookie authCookie = cookies[result.CookieName];
RS =
berria ReportingService2006();
rs.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
berria CookieContainer();
rs.CookieContainer.Add(authCookie);
}
saiatu
{
  rs.CreateSubscription(berri, extSettings, desc, eventType, Jokoaren datuak, parameters1);
}
harrapatzeko (Exception ex)
{
  Console.WriteLine(ex.Message.ToString());
}

Gauzak horrela interpretatu dut:

  • Autentifikazio-zerbitzua sortu markatu eta esan behar da gure web parte, "Hey, Tony, me da!".
  • Autentifikazio zerbitzua erantzunak esaten, "Hey, I know you. How are the kids? Here’s a token."
  • SSRS deitzen diogu, zerbitzu eta esatea, "Tony sent me, Hemen token."

</amaiera>

Nire blog Harpidetu.

Utzi iruzkin bat

Zure e-posta helbidea ez da argitaratuko. Beharrezko eremuak markatu dira *