none
Accessing server with PSI CONFUSION/CLARIFICATION RRS feed

  • Question

  • Hi,

    We use Microsoft Project 2010 to manage project related tasks. I created a web page to access the project list with use of web service(project app url which is working).

    Not tried WCF route since I dont have the project server GUID. Have couple of queries on this

    1. Can I get Project server GUID from remote machine?

    2. Do we need to be in Admin role to access WCF/OData services?

    I am also trying other option to call the web service via Ajax/Jquery(Not sure if that work/ feasible). I created request and fired the project server WSDL web service url and what I got response was WSDL xml document. I tried passing user credentials to the $.ajax request but that too failing/returned only WSDL document. sample below. 

    var soapRequest = '<?xml version="1.0" encoding="utf-8"?> \
                                    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
                                        xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
                                        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> \
                                      <soap:Body> \
                                        <ReadProjectList />  \
                                      </soap:Body> \
                                    </soap:Envelope>';

                $.ajax({
                    type: 'POST',
                    datatype: 'xml',
                    processData: false,
                    url: 'https://<project_server>/<project>/_vti_bin/PSI/Project.asmx?wsdl',
                    username: username,  // Most SAP web services require credentials
                    password: password,
                    data: soapRequest,
                    crossDomain: true,
                    xhrFields: {
                        withCredentials: true
                    },
                    success: processSuccess,
                    error: processError
                });

    Is it possible to use a simple HTML page and use jquery/ajax to call project services? if for any security reasons, it is not achievable, can I create a dummy ASP.Net web page/project (just to run as localhost) and call this HTML from URL? Will that work?

    The last question

    Can I get the microsoft project GUID(outline level zero) manually from microsoft project desktop application? What we see inside the application are sublevel tasks(1 and above)?


    --- Thanks & Regards, Guhan

    Friday, January 29, 2016 9:24 AM

All replies

  • Looks like it is not as easy. I have moved the code to Powershell scripting and was able populate the project list to the grid view control. So just sharing the script will work independently and no IIS or server required.

    Still, the last question need some answer if any one knew.



    --- Thanks & Regards, Guhan

    Tuesday, February 2, 2016 11:28 AM
  • All,

    I have created web service proxy in powershell and able to retrieve the list of projects from the project server. It was quick and easy. however To get details for individual project I need to call ReadProjectEntities(guid, project entity type, DataStore Enum) method

    I could pass Guid, flag but not sure how to refer and pass the Datastoreenum(which is C# Enum). I tried multiple things / code but I get different errors. I tried to import module for web.services but nothing working

    $pwaUrl = “https://<server>/<project>”
    $pwaPSUrl_Projectasmx = "/_vti_bin/PSI/Project.asmx?wsdl"
    $svcPSUrl = $pwaUrl + $pwaPSUrl_Projectasmx
    $pwaPROJECT_ENTITY_TYPE_TASK_AND_RESOURCE = $pwaPROJECT_ENTITY_TYPE_TASK -or $pwaPROJECT_ENTITY_TYPE_RESOURCE

    $myCred = Get-Credential

    $svcPSProxy = New-WebServiceProxy -uri $svcPSUrl -credential $myCred
    echo "proxy created"

    [System.Enum]$pwaDataStoreEnum =  $svcPSProxy.DataStoreEnum # this not returning as enum.
    echo "Enum " $pwaDataStoreEnum.GetType() // this gives error.

    #equivalent method in ASPX page with C# code is below

    MyProjectWebReference.ProjectDataSet readProjDs = projectSvc.ReadProjectEntities(guid, PROJECT_ENTITY_TYPE_TASK_AND_RESOURCE, MyProjectWebReference.DataStoreEnum.WorkingStore);

    $pwaDataStoreEnum = [System.Xml.Serialization.XmlTextAttribute]::DataStoreEnum
    echo  "Data Store Enum" $pwaDataStoreEnum // This too return nothing


    Anyone have suggestions/thoughts?



    --- Thanks & Regards, Guhan

    Thursday, February 4, 2016 9:33 AM