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: Ekki heimilt
- Object Færð
The "object moved" message was most interesting because it was saying that the "object" (SSRS þjónustu okkar) had "moved" to login.aspx. This clearly meant we had some kind of authentication problem.
I eventually realized that I had bookmarked a blog entry 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 (og með 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".
Hér er kóðinn sem starfaði fyrir okkur:
ReportingService2006 rs = núll; // Authenticate Authentication auth = ný Authentication(); ef (result.ErrorCode == LoginErrorCode.NoError) reyna { rs.CreateSubscription(report, extSettings, desc, eventType, matchData, parameters1); } veiða (Undantekning fyrrverandi) { Console.WriteLine(ex.Message.ToString()); } |
I interpret things to work like this:
- Our web part needs to dial up the authentication service and say, "Hey, Tony, it’s me!".
- Authentication service replies saying, "Hey, I know you. How are the kids? Here’s a token."
- We call up the SSRS service and say, "Tony sent me, here’s the token."
</enda>