Friday, April 12, 2013

BIMonitoringAuthoringServiceProxy, BIMonitoringServiceApplicationProxy and SPDataStore

BIMonitoringAuthoringServiceProxy, BIMonitoringServiceApplicationProxy and SPDataStore


To do custom development against SharePoint 2010 PerformancePoint services, there are three sets of API you can use.

1. BIMonitoringAuthoringServiceProxy
2. BIMonitoringServiceApplicationProxy
3. SPDataStore

1. BIMonitoringAuthoringServiceProxy

This one is the least documented but the most useful one. According to http://msdn.microsoft.com/en-us/library/ee556849(v=office.14).aspx , BIMonitoringAuthoringServiceProxy is an internal class that shouldn't be used.

Actually BIMonitoringAuthoringServiceProxy is a public class and according to book such as Microsoft SharePoint 2010 PerformancePoint Services Unleashed, this is the API should be used when program against PerformancePoint servcies.

The is the API that can create and reretrieve all of the PerformancePoint objects through web servcies calls. SPDataStore API can do the extactly same things too but its calls are not remote calls and must be made on the same the server that PerformancePoint service is deployed.

This is an important difference, since PerformancePoint service is not necessarily deployed to the web front end server where the application will run. PerformancePoint service could run on an application server which is different from the WFE. In this case, your custom BI applications which could be an application page, web parts, or feature activation which usually run from WFE will not be able to use SPDataSource API. For this reason, only BIMonitoringAuthoringServiceProxy should be used to make reliable calls to PerformancePoint servcie.

The syntax to use BIMonitoringAuthoringServiceProxy is

string webServiceUrl = "/_vti_bin/pps/PPSAuthoringService.asmx";
IBIMonitoringAuthoring biService = BIMonitoringAuthoringServiceProxy.CreateInstance(siteUrl + webServiceUrl);
biService.CreateDataSource(SiteServerRelativeUrl + connectionListUrl, dataSource);
CreateInstance returns object of type IBIMonitoringAuthoring. However if you search for IBIMonitoringAuthoring, you won't find any documentation about it. Since it implements IBIMonitoringStore, you can find the API documentation at
http://msdn.microsoft.com/en-us/library/microsoft.performancepoint.scorecards.ibimonitoringstore_members.aspx

2. BIMonitoringServiceApplicationProxy

BIMonitoringServiceApplicationProxy is similiar to BIMonitoringAuthoringServiceProxy as a web service API but unlike BIMonitoringAuthoringServiceProxy, BIMonitoringServiceApplicationProxy is well documented by MSDN. It seems this API is the recommended API to use by MS but it lacks many of the functionalities of BIMonitoringAuthoringServiceProxy.

Also BIMonitoringServiceApplicationProxy requires running in the context of SharePoint such as running from a SharePoint page, if you use BIMonitoringServiceApplicationProxy from a console app without SharePoint context, you will get error "The SharePoint Service context is not known".

3. SPDataStore

As described above, this API is a server side object model and can only be used when PerformancePoint service is deployed to the server which may not always be the case. For reliability, the web servcie API should be used instead.

As an example to show that in some cases all three API can achieve the exact same thing, please see the next three methods

BIMonitoringServiceApplicationProxy.CreateDataSource Method
http://msdn.microsoft.com/en-us/library/microsoft.performancepoint.scorecards.bimonitoringserviceapplicationproxy.createdatasource(v=office.14).aspx

SPDataStore.CreateDataSource Method
http://msdn.microsoft.com/en-us/library/microsoft.performancepoint.scorecards.store.spdatastore.createdatasource(v=office.14).aspx

IBIMonitoringStore.CreateDataSource method
http://msdn.microsoft.com/en-us/library/microsoft.performancepoint.scorecards.ibimonitoringstore.createdatasource.aspx

They all have the exact same API
public DataSource CreateDataSource(string listUrl, DataSource dataSource)

A few useful links for PerformancePoint development

http://blogs.msdn.com/b/performancepoint/
http://msdn.microsoft.com/en-us/library/bb848116(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/ee559635.aspx
http://msdn.microsoft.com/en-US/office/bb660518

No comments:

Post a Comment