არა მარტო აპელირებს SSRS ვებ სერვისები WSS / MOSS in 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: არ
  • ობიექტის გადატანილი

The "object moved" message was most interesting because it was saying that the "object" (ჩვენი SSRS მომსახურება) had "moved" to login.aspx. This clearly meant we had some kind of authentication problem.

მე საბოლოოდ მიხვდა, რომ მე მქონდა ჩანიშნული წაკითხვა შესვლის 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 (როგორც 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".

აი კოდი, რომელიც მუშაობდა ჩვენთვის:

ReportingService2006 რს = ნულოვანი; 
// სინამდვილის ავთენტიფიკაცია auth = ახალი ავთენტიფიკაცია(); 
auth.Url = "http://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
ახალი CookieContainer();
LoginResult შედეგი = auth.Login("userid", "password");
თუ (result.ErrorCode == LoginErrorCode.NoError) 
{
// არ შეცდომა, ასე რომ მიიღოს cookies.
CookieCollection cookies = auth.CookieContainer.GetCookies(ახალი Uri(auth.Url));
Cookie authCookie = ნაჭდევები[result.CookieName];
რს =
ახალი ReportingService2006();
rs.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
ახალი CookieContainer();
rs.CookieContainer.Add(authCookie);
}
ვცდილობთ
{
  rs.CreateSubscription(ანგარიშს, extSettings, დაღმ, eventType, matchData, parameters1);
}
დაჭერა (გამონაკლისი ყოფილი)
{
  Console.WriteLine(ex.Message.ToString());
}

მე ინტერპრეტაცია რამ მუშაობა მოსწონს:

  • ჩვენი ვებ ნაწილი უნდა აკრიფეთ up ავთენტურობის მომსახურება და აცხადებენ,, "Hey, ტონი, ეს მე ვარ!".
  • ავთენტურობის მომსახურება გამოხმაურება ამბობდა, "Hey, I know you. How are the kids? Here’s a token."
  • ჩვენ მოვუწოდებთ up SSRS მომსახურება და აცხადებენ,, "Tony sent me, აქ ნიშნად."

</ბოლო>

გამოწერა ჩემი დღიური.

დატოვე პასუხი

თქვენი ელ-ფოსტა არ გამოქვეყნდება. აუცილებელი ველები მონიშნულია *