开发者

Get the authentication method of a SQL Report Service

Is it possible to get the authentication method of a SQL Report Service? I have an application to deploy RDLs (found here by the way). It has the following code (simplified):

ReportingService2005 ws = new ReportingService2005();
ws.Url = url;
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
ws.CreateReport(....)
// and so on

But what if a server needs a username and password? As this piece of code will be used on multiple servers, I would need a method to request the authentication method first. If its integrated security, I could use the code above. If not, I could ask the user a username and password.

I've tried with ws.GetSystemProperties to request the EnableIntegratedSecurity 开发者_开发技巧property, but I still get an exception (407 Proxy Authentication Required). I could catch the exception and then prompt for username and password, but prefer not to use this exception-driven style.


Seeing as noone is answering this anymore, and probably never will, I'm going to assume I'll have to use the exception-way:

If the above code doesn't work, catch the exception and request a username and password. Then call CreateReport with those credentials. If there's another exception, handle it gracefully...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜