WSS வரம்பு SSRS வலை சேவைகள் நாடுவதன் / 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.Url = "HTTP://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
புதிய CookieContainer();
LoginResult விளைவாக = auth.Login("userid", "password");
என்றால், (result.ErrorCode == LoginErrorCode.NoError) 
{
// இல்லை பிழை, எனவே குக்கீகளை கிடைக்கும்.
CookieCollection குக்கீகளை = auth.CookieContainer.GetCookies(புதிய யூரி(auth.Url));
குக்கீ authCookie = குக்கீகளை[result.CookieName];
ரூ =
புதிய ReportingService2006();
rs.Url =
"HTTP://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
புதிய CookieContainer();
rs.CookieContainer.Add(authCookie);
}
முயற்சி
{
  rs.CreateSubscription(புகார், extSettings, DESC, eventType, தரவு பொருந்தவில்லை, parameters1);
}
பிடி (தவிர முன்னாள்)
{
  Console.WriteLine(ex.Message.ToString());
}

நான் விஷயங்கள் இந்த போல வேலை செய்ய மொழிபெயர்க்கும்:

  • எங்கள் வலை பகுதி அங்கீகார சேவை தொலைபேசிவழி மற்றும் சொல்ல வேண்டும், "Hey, டோனி, அது நான் தான்!".
  • அங்கீகார சேவை பதில்கள் கூறி, "Hey, I know you. How are the kids? Here’s a token."
  • நாம் SSRS சேவை அழைத்து சொல்ல, "Tony sent me, இங்கே டோக்கன் தான்."

</இறுதியில்>

என்னுடைய குழுசேர்.

ஒரு பதில் விட்டு

உங்கள் மின்னஞ்சல் முகவரி வெளியிடப்பட்ட முடியாது. தேவையான புலங்கள் குறிக்கப்பட்டன *