Hello folks,
I now need to make some PSI calls to get some Project Server data, and as I was expecting,PSI CALLS DO NOT WORK IN PS2013 !
I have created a very simple SharePoint 2013 project (under Visual Studio 2012) aiming at testing PSI calls within an application page. In the page load event of the page, I have added the following code :
protectedvoidPage_Load(object sender,EventArgs e){try
{
ProjectContext pj =newProjectContext("http://ps2013-ts-qve/sandbox/");
pj.Load(pj.EnterpriseResources);
pj.ExecuteQuery();
lblMessage.Text="PSI Call succeeded!";
}
catch(Exception ex)
{
lblError.Text= ex.ToString();
}}
The user executing this code is declared as an administrator in PWA, so there shouldn't be any errors, but here is the error I get:
Access denied. You do not have permission to perform this action or access this resource. at Microsoft.SharePoint.Client.ServerStub.CheckRequiredResourceRight(ProxyContext proxyContext, String memberName, ResourceRight right) at Microsoft.SharePoint.Client.ServerStub.CheckBlockedMethod(String methodName, ProxyContext proxyContext) at Microsoft.ProjectServer.PSContextServerStub.InvokeConstructor(XmlNodeList xmlargs, ProxyContext proxyContext) at Microsoft.SharePoint.Client.ServerStub.InvokeConstructorWithMonitoredScope(XmlNodeList args, ProxyContext proxyContext) at Microsoft.SharePoint.Client.ClientMethodsProcessor.InvokeConstructor(String typeId, XmlNodeList xmlargs) at Microsoft.SharePoint.Client.ClientMethodsProcessor.GetObjectFromObjectPath(XmlElement xe) at Microsoft.SharePoint.Client.ClientMethodsProcessor.GetObjectFromObjectPathId(String objectPathId) at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessInstantiateObjectPath(XmlElement xe) at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessOne(XmlElement xe) at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessStatements(XmlNode xe) at Microsoft.SharePoint.Client.ClientMethodsProcessor.Process()
...
Can someone at MICROSOFT provide the solution to make this code work ???