Using the PPSAuthoringService Web Service
Because calling web services remotely is not an officially supported scenario for PerformancePoint Services development, there's no related information in the SDK. The SDK uses the BIMonitoringServiceApplicationProxy and SPDataStore objects to perform authoring and processing tasks from code running within the SharePoint environment. However, should you choose to author content remotely through the web service, here is some information that you may find useful.
About PPSAuthoringService
The PPSAuthoringService web service (was PmService in PerformancePoint 2007) contains web methods you can use to create, get, update, and delete first class objects (FCOs) and to retrieve metadata from data sources.
Note: PPSAuthoring only provides a few options for retrieving result data. The GenerateView and GenerateViewDirect methods return scorecard data, and the GetPreviewDataSet method retrieves a specified number of rows from a tabular data source.
The default URL for PPSAuthoringService is http[s]://[server]/[site collection path]/_vti_bin/pps/PPSAuthoringService.asmx, and its underlying class is BIMonitoringAuthoringService. Example: https://PPS14Demo/BICenter/_vti_bin/pps/PPSAuthoringService.asmx
Note: PerformancePoint Services exposes two other web services at the site-collection level: PPSRenderingService and PPSDecompRenderingService. PPSRenderingService, which was named RenderingService in PerformancePoint 2007, supports JavaScript Object Notation (JSON) only.
There are two ways that you can make client-side calls to PPSAuthoringService.
· Use the BIMonitoringAuthoringServiceProxy object. This option requires access to the Microsoft.PerformancePoint.Scorecards.Client DLL, but it provides better object-level support—and therefore a simpler programming model—for remotely authoring and processing FCOs (scorecards, reports, filters, KPIs, indicators, and dashboard page definitions (but not the dashboards that are deployed to SharePoint)). See the "Using BIMonitoringAuthoringServiceProxy" and "Using the GetListItems Method to Retrieve FCOs" sections below for code examples.
· Use the auto-generated proxy code generated from the WSDL. This option does not require access to any PerformancePoint Services DLLs, but it typically requires more complicated coding. See the "Using the WSDL proxy code" section below for a code example.
Using BIMonitoringAuthoringServiceProxy
BIMonitoringAuthoringServiceProxy sits between PerformancePoint Dashboard Designer and the PPSAuthoringService web service. Dashboard Designer uses BIMonitoringAuthoringServiceProxy for the SOAP/XML communication with PPSAuthoringService.
To use BIMonitoringAuthoringServiceProxy in your web application, you must add a reference to the Microsoft.PerformancePoint.Scorecards.Client DLL and a using directive to the Microsoft.PerformancePoint.Scorecards namespace. The DLL is installed with Dashboard Designer and with the application server. To locate the DLL on the client, run Dashboard Designer, open Task Manager, and in the Process tab, right-click DashboardDesigner.exe and select Open File Location. See PerformancePoint Services DLLs Used in Development Scenarios for more information about finding server DLLs.
The following code example shows how to instantiate a BIMonitoringAuthoringServiceProxy object and create a report using the .NET Framework 3.5.
// Instantiate a BIMonitoringAuthoringServiceProxy object.
IBIMonitoringAuthoring authoring = BIMonitoringAuthoringServiceProxy.CreateInstance("https://localhost/_vti_bin/PPS/PPSAuthoringService.asmx");
// Define the server-relative URL for the new report.
string listUrl = "/BI Center/Lists/PerformancePoint%20Content/";
// Define report properties.
ReportView newReport = ReportView.CreateNew();
// Define report properties. SubTypeId and Name are required.
newReport.SubTypeId = ReportViewNames.Url;
newReport.Name.Text = "Auto-generated Report";
newReport.Description.Text = "Report created with BIMonitoringAuthoringServiceProxy";
newReport.Owner.Login = "";
// Url reports store a URL in the CustomData property.
newReport.CustomData = "https://www.bing.com/search?q=performancepoint+services+2010&form=QBRE HTTP/1.1";
// Create the report.
authoring.CreateReportView(listUrl, newReport);
Note: You must define the Name property when you create an FCO; otherwise, you receive the error "Server was unable to process request. You do not have permissions to create a report in this list."
Using the GetListItems Method to Retrieve FCOs
PerformancePoint 2007 included web methods to retrieve collections of FCOs (such as GetDashboards to retrieve the dashboard collection). In PerformancePoint 2010, you use the GetListItems method to retrieve all FCOs stored in a PerformancePoint Content or PerformancePoint Data Connections list. Then, you can filter for FCOs of a particular type, as shown in the following extension method that retrieves all dashboards. You must instantiate BIMonitoringAuthoringServiceProxy (shown in the previous example) before you can call this method using the .NET Framework 3.5.
public static class IBIMonitoringAuthoringExtensions
{
public static List<Dashboard> GetDashboards(this IBIMonitoringAuthoring authoring, string listUrl)
{
var dashboards = new List<Dashboard>();
foreach(var item in authoring.GetListItems(listUrl))
{
if (item is Dashboard)
{
dashboards.Add(item as Dashboard);
}
}
return dashboards;
}
}
Using the WSDL Proxy Code
The following code example shows how to use the WDSL proxy to initialize an instance of a BIMonitoringAuthoringService object, create a report, and create and assign the name, description, and owner properties for the report. In the example, "PPSAS" represents the web reference set to PPSAuthoringService.
Note: After you create a web service proxy from the command line or in Visual Studio using the WSDL, you must manually remove three lines of code from the proxy object model. Otherwise, you get the following errors if you try to call the web service: "Unable to generate a temporary class" and "Cannot convert type" MemberTransform or Member. Steps to resolve these errors are described in the "Remove Three Lines of Code Before Calling the Web Service" section after the code example.
// Initialize a new instance of the Web service.
PPSAS.BIMonitoringAuthoringService authService = new PPSAS.BIMonitoringAuthoringService();
// Use the credentials of the logged-on user.
authService.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Define the server-relative URL for the new report.
string listUrl = "/BI Center/Lists/PerformancePoint%20Content";
// Define report properties.
PPSAS.ReportView newReport = new PPSAS.ReportView
{
// Define the required SubTypeId property.
SubTypeId = "Url",
// Url reports store a URL in the CustomData property.
CustomData = "https://bing.com/search?q=performancepoint+services+2010&form=QBRE HTTP/1.1"
};
#region BpmProperties
// Define the report Properties property, which is a collection of three BpmProperty objects.
// Define Element_Name. This property is required.
PPSAS.BpmPropertyText bpmName = new PPSAS.BpmPropertyText
{
Description = "Description of the Name property.",
DisplayName = "Name",
Required = false,
Visible = true,
// This is the display name for the report.
Text = "Autogenerated Report",
// The UniqueName property must be defined exactly as shown.
UniqueName = "8dd07d4d87794510afdb1f07664359bc_Element_Name"
};
// Define Element_Description.
PPSAS.BpmPropertyLongText bpmDescription = new PPSAS.BpmPropertyLongText
{
Description = "Description of the Description property.",
DisplayName = "Description",
Required = false,
Visible = true,
// This text displays on the Properties tab in Dashboard Designer and
// in the PerformancePoint Content list.
Text = "Report created with the WSDL.",
// The UniqueName property must be defined exactly as shown.
UniqueName = "8dd07d4d87794510afdb1f07664359bc_Element_Description"
};
// Define Element_Owner.
PPSAS.BpmPropertyUser bpmOwner = new PPSAS.BpmPropertyUser
{
Description = "Description of the Person Responsible property.",
DisplayName = "Person Responsible",
Required = false,
Visible = true,
// This text displays on the Properties tab in Dashboard Designer and
// in the PerformancePoint Content list.
Login = "",
// The UniqueName property must be defined exactly as shown.
UniqueName = "8dd07d4d87794510afdb1f07664359bc_Element_Owner"
};
// Create a BpmProperty collection and add the new properties.
PPSAS.BpmProperty[] bpmProperties = new PPSAS.BpmProperty[3];
bpmProperties[0] = bpmName;
bpmProperties[1] = bpmDescription;
bpmProperties[2] = bpmOwner;
// Assign the properties to the new report.
newReport.Properties = bpmProperties;
#endregion
// Create the report.
authService.CreateReportView(listUrl, newReport);
Remove Three Lines of Code Before Calling the Web Service (WSDL only)
1. In the Solution Explorer pane in Visual Studio, double-click the PPSAuthoringService web service reference to display the auto-generated proxy objects in the Object Browser tab.
2. Expand the web service namespace and double-click the PropertyBag class. Remove the following lines from the Values property definition:
[System.Xml.Serialization.XmlArrayItemAttribute(typeof(Member), NestingLevel=1)]
[System.Xml.Serialization.XmlArrayItemAttribute(typeof(MemberTransform), NestingLevel=1)]
[System.Xml.Serialization.XmlArrayItemAttribute(typeof(string), NestingLevel=1)]
3. Rebuild your project.
This workaround applies to proxies that you create from the command line and proxies that Visual Studio automatically generates for web references or service references that are added to projects.
Josh Unger, Tim Morgan, Diane Diaz
Related information
PerformancePoint Services Scorecard Data Collection Sample (calls PPSAuthoringService using BIMonitoringAuthoringServiceProxy)
SPDataStore Class (contains code examples for FCO CRUD methods)
BIMonitoringServiceApplicationProxy Class
Code Sample: Custom Report, Filter, and Tabular Data Source Objects
Development Scenarios with PerformancePoint Services
[MS-PPSAS]: PerformancePoint Services Authoring Service Protocol Specification
Comments
Anonymous
December 06, 2010
Really helpful , i was wondering if there is a way to retrieve reports and their mdx from dashboards deployed to a site collection ?Anonymous
March 13, 2012
Has anyone seen any errors related to the FCODAO object? Our error seems to implicate the BIMonitoringAuthoringServiceProxy ...
Exception: Server was unable to process request. ---> Unable to load first class object Dao provider type: FilterSPDao /N Stack Trace: at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Microsoft.PerformancePoint.Scorecards.BIMonitoringAuthoringServiceProxy.UpdateFilter(Filter filter) at HuronProjectSiteCreator.ProjectCreator.ProjectCreatorUtility.<>c__DisplayClassd.<UpdatePerformancePointLibrary>b__a() at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at HuronProjectSiteCreator.ProjectCreator.ProjectCreatorUtility.UpdatePerformancePointLibrary(SPWeb webSite, String projectCode, String sourceProjectTemplateSiteName, String performancePointContentListName, String performancePointDbConnectionsListName)
R. Rivas Chicago
- Anonymous
September 05, 2012
Thanks for the article.
- I am trying to set the properties of PPS Data Source through a c# console application.
- I was able to add the web reference to PPSAuthoringService, however I donot see BIMonitoring, I just see PPSAuthoringService and added a reference to it.
- For getting the data source, I am using RepositoryLocation and setting the ItemUrl property.
- When I try to GetDataSource using the above RepositoryLocation I am getting an error saying "The Object has been moved". Not sure what else can be done to give the correct path. I dont see any other resource in the web which talk about PPSAuthoringService. I am able to open the path using IE or Dashboard Designer. My PPSAuthoringService path is "http://servername/sites/wphp/_vti_bin/pps/PPSAuthoringService.asmx" PPSService.PPSAuthoringService pps = new PPSService.PPSAuthoringService(); pps.Credentials = spCredential; PPSService.RepositoryLocation dbConnectionLocation = new PPSService.RepositoryLocation(); dbConnectionLocation.ItemUrl = "/sites/wphp/Data%20Connections%20for%20PerformancePoint"; PPSService.DataSource ppsDataSource = pps.GetDataSource(dbConnectionLocation); ppsDataSource.SourceName = "Name"; ppsDataSource.ServerName = "ServerName"; ppsDataSource.DatabaseName = "DatabaseName"; ppsDataSource.CubeName = "CubeName"; ppsDataSource.FormattingDimensionName = "Dimension"; ppsDataSource.MinutesToCache = 1; //ppsDataSource.ConnectionContext = PPSService.ConnectionContext.ConnectAsSharedUser; pps.UpdateDataSource(ppsDataSource); It fails at GetDatabase method. Hope some one can help me out from your team. Thanks, Raghav
- Anonymous
February 10, 2015
The comment has been removed