WSS dən SSRS Web Services Invoking / FBA Ətraf Mühit 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: Səlahiyyətli deyil
  • Obyekt köçürülüb

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

Mən nəhayət mən ki, həyata keçirilir sık bir blog giriş 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 (kimi 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".

Burada bizim üçün çalışıb ki, kod:

ReportingService2006 rs = null; 
// Təsdiq etmək Authentication İcazə = yeni Authentication(); 
auth.Url = "http://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
yeni CookieContainer();
LoginResult nəticə = auth.Login("userid", "password");
əgər (result.ErrorCode == LoginErrorCode.NoError) 
{
// No səhv, belə cookies almaq.
CookieCollection cookies = auth.CookieContainer.GetCookies(yeni Uri(auth.Url));
Cookie authCookie = cookies[result.CookieName];
rs =
yeni ReportingService2006();
rs.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
yeni CookieContainer();
rs.CookieContainer.Add(authCookie);
}
cəhd
{
  rs.CreateSubscription(məlumat, extSettings, Azalan, eventType, matchData, parameters1);
}
tutmaq (Istisna ex)
{
  Console.WriteLine(ex.Message.ToString());
}

Mən hər şeyi bu kimi işləmək üçün şərh:

  • Bizim web hissəsi identifikasiyası xidmət yığmaq və demək lazımdır, "Hey, Tony, mənə var!".
  • Authentication xidməti cavab söyləyərək, "Hey, I know you. How are the kids? Here’s a token."
  • Biz SSRS xidmət zəng və demək, "Tony sent me, burada mö'cüzə var."

</son>

Blog abunə.

Şəkil Yükləmə

E-poçt ünvanından dərc olunmayacaq. Lazım alanlar qeyd olunur *