Trying to Communicate

Visual Studio 2008 embraces the exciting new world of Windows Communication Foundation (WCF) for communicating with services. However, pitfalls await the unwary. I’ve recently tackled invoking the Reporting Services Web service with WCF and I want to share my findings.

  1. The Visual Studio Add Web Reference menu has been renamed to Add Service Reference to denote that WCF can communicate with much more than Web services, including probably my Zune device. Although the dialog has somewhat changed, you will be find your way to generate the proxy.
  2. What’s more surprising is that the auto-generated proxy methods now have somewhat different signatures.

For example, the SQL Server Books Online has the following signature of the Reporting Services GetExecution Options API.

public ExecutionSettingEnum GetExecutionOptions (string Report,out ScheduleDefinitionOrReference Item);

Yet, WCF generates the following signature:

public ServerInfoHeader GetExecutionOptions(string Report, out ExecutionSettingEnum executionOption, out ScheduleDefinitionOrReference Item);

So, the returned value becomes an out parameter while ServerInfoHeader becomes a returned value. I am not sure how WCF figures this out. Does it mean that now the documentation should show both the 2.0 and WCF signatures?

  1. The second surprise wave hit me when I was trying to figure out a way to pass my credentials to the Web service. This, of course, will probably be one of the first things you need to do to invoke an Intranet service.

In the good ol’ 2.0 days, impersonating the user takes a single line of code.

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

How do we this in the shiny new WCF world? Strangely, the Visual Studio help says little about this. I came across some bizarre examples of declaring HTTP transports that made my head spin. In a sheer stroke of luck, I managed to figure out the right changes in the application config file (yes, now we have declarative settings).

<security mode=”TransportCredentialOnly“>

<transport clientCredentialType=”Ntlm” proxyCredentialType=”None” realm=”” />

<message clientCredentialType=”UserName” algorithmSuite=”Default” />

</security>

Wait! We need to tell WCF also that is OK to impersonate the user.

ReportingService2005SoapClient rs = new ReportingService2005SoapClient();

rs.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

At this point, I felt like upgrading my house only to find that I have to enter through the chimney. Upgrading to a new technology shouldn’t complicate things unnecessarily. I promptly switched back to the 2.0 style of programming. Luckily, they kept the old Add Web Reference button from the advanced settings of the Add Service Reference dialog.

I guess they were right. You can’t teach an old dog new tricks…

Happy holidays!

Analysis Services Many-to-Many Dimensions: Query Performance Optimization Techniques Whitepaper Available

The Microsoft CAT team has released a new whitepaper Analysis Services Many-to-Many Dimensions: Query Performance Optimization Techniques.

“Many-to-many dimension relationships in SQL Server 2005 Analysis Services (SSAS) enable you to easily model complex source schemas and provide great analytical capabilities. This capability frequently comes with a substantial cost in query performance due to the runtime join required by Analysis Services to resolve many-to-many queries. This best practices white paper discusses three many-to-many query performance optimization techniques, including how to implement them, and the performance testing results for each technique. It demonstrates that optimizing many-to-many relationships by compressing the common relationships between the many-to-many dimension and the data measure group, and then defining aggregations on both the data measure group and the intermediate measure group yields the best query performance. The results show dramatic improvement in the performance of many-to-many queries as the reduction in size of the intermediate measure group increases. Test results indicate that the greater the amount of compression, the greater the performance benefits—and that these benefits persist as additional fact data is added to the main fact table (and into the data measure group).”

Brian Welcker Leaving SSRS

As he posted here, Brian Welcker (Group Program Manager of Reporting Services) is leaving the Reporting Services team and moving to the Microsoft Healthcare Solutions Group. Brian did so much to build and promote Reporting Services. SSRS wouldn’t have been the same if it wasn’t for Brian. The technical community (myself included) will surely miss him.

Let’s wish Brian good luck with his new career!

Relational Guide to Monitoring and Analyzing with Microsoft Office PerformancePoint Server 2007

As you know, business scorecards are the latest BI craze. Nick Barclay was kind enough to send me a copy of his new book Monitoring and Analyzing with Microsoft Office PerformancePoint Server 2007 by Rational Press which he co-authored with a co-worker and friend Adrian Downes. This is one of these relatively-small and very practical books which helps you hit the ground running quickly. As its name suggests, the book focuses only on the monitoring and analyzing piece of PerformancePoint which was previously known as Business Scorecard Manager. Nick and Adrian wrote another book, the Rational Guide to Planning with Microsoft Office PerformancePoint Server 2007, which covers the Biz# portion of the product.

I liked the author style and the practical examples included in the book. The authors show you how to build scorecards from a variety of data sources and deploy them to SharePoint or Reporting Services reports. I didn’t know that you can create a Visio strategy map and hook it to the scorecard. Too bad that the ProClarity stuff didn’t get integrated into BSM. I guess we have to wait for another release to get the cool decomposition tree when you click on a KPI. Until then, Visio strategy maps J

121607_0358_RelationalG1

Getting Rid of the Vista Credentials Prompt

There could be 1001 reasons why IE asks you for credentials when you access a website configured for Windows Authentication and none of them has to do with Reporting Services itself. Windows Vista and IE 7 add yet another one. IE 7 will prompt you for credentials if your computer is not added to a domain and you access a local website configured for Windows Authentication, such as http://localhost/reports. Thanks to the help from James Wu on the SSRS team and Bryan Noyes’s blog, the solution is simple.

  1. Open IE and go to Tools, Internet Options, Security tab.
  2. Select the Local Intranet zone. Press the Sites button.
  3. Unselect the Automatically detect intranet network checkbox and check the three checkboxes below it.
  4. Restart IE. Now http://localhost/Reports or http://localhost/ReportServer shouldn’t prompt for credentials.

120607_2346_GettingRidO1

If it still prompts and you have SQL Server 2008 installed, it could be an issue with Kerberos. To fix this, open the ReportServer configuration file (rsreportserver.config). Locate the following section:

<Authentication>

<AuthenticationTypes>

<!–RSWindowsNegotiate/–>

<RSWindowsNTLM/>

</AuthenticationTypes>

<EnableAuthPersistence>true</EnableAuthPersistence>

</Authentication>

Comment the <RSWindowsNegotiate/> element or remove it, so only <RSWindowsNTLM/> is enabled.