none
Using Statusing with Impersonation over ASMX RRS feed

  • Question

  • Hi,
     
    I want to run my existing 2007 app that uses impersonation to access the statusing webservice against 2010. I've read the documentation and it says: Existing applications that use the ASMX interface can use the URL only through Project Web App, which checks Project Server permissions. (http://msdn.microsoft.com/en-us/library/aa568853.aspx)
     
    In my old app I had to configure:
     
    pwaUrl, like http://server/pwa/_vti_bin/psi/statusing.asmx
    sspUrl, like http://server:56737/SSP/psi/statusing.asmx
    pwaSiteId, like B258ACBA-CDF2-4201-AF13-DC7B8CA5BCB7


    and my impersonation user needed to have admin permissions on Project Server and the identity of the PwaSite.


    Since I want to reuse my code. What do I have to specify for the three parameters above?


    Thanks in advance for any advice
    Adrian

    P.S. since I want to read and write timephased data to the statusing webservice I need to use impersonation.

    Thursday, July 1, 2010 4:08 PM

Answers

  • The Statusing.UpdateStatus method can apply actuals to an assignment for a user other than the assigned resource. Here are the considerations:

    • In Project Server 2007, with an application run by someone other than the assigned user -- such as the Project Server administrator -- you’d have to use impersonation. That is, without impersonation, the application user must be the one who is assigned to the task.
    • In Project Server 2010, you can use the new ResID attribute for the Assn element in the changeXml string parameter for UpdateStatus, which enables you to avoid impersonation.
    • The application user must have the StatusBrokerPermission global permission, to be able to update data for another user.
      The changeXml string parameter for UpdateStatus can be tricky to create. For a tool to create it, see How to: Generate ChangeXML for Statusing Updates, and get the tool and source in the Project 2007 SDK download (as is, the 2007 tool does not create the new ResID attribute).
    • The ChangeList schema is a little different in Project Server 2010, from 2007 – new attributes are ResID and ChangeNumber.
    • However, UpdateStatus does not work for changes to a task for another user. That is, the changeXml parameter works for assignment fields, but not for task fields for different users. See Supported Project Fields and Field Information for Statusing ChangeXML.

    So, your existing application should be changed. Because of the switch to claims authentication and the WCF infrastructure, ASMX-based impersonation no longer works the same way. The application no longer needs to use impersonation, if you update the changeXml parameter and assign the StatusBrokerPermission perm to the user.

    --Jim

    • Marked as answer by Jim Corbin Saturday, July 10, 2010 5:17 PM
    Saturday, July 10, 2010 5:16 PM

All replies

  • Hi Adrian,

    Instead of using the ReadStatus and SubmitStatus methods with impersonation, you can use ReadStatusForResource and SubmitStatusForResource without impersonation. That's a much better solution, if those are the reasons you used impersonation in Project Server 2007.

    Otherwise, if you really do need impersonation, we recommend that you port the application to use the WCF interface.

    --Jim

    Thursday, July 1, 2010 11:42 PM
  • Hi Jim,

    as stated above I want to read and write timephased data to the statusing webservice therefore I need to use impersonation.

    Any advice?

    Thanks,

    Adrian

    Friday, July 2, 2010 10:14 PM
  • The Statusing.UpdateStatus method can apply actuals to an assignment for a user other than the assigned resource. Here are the considerations:

    • In Project Server 2007, with an application run by someone other than the assigned user -- such as the Project Server administrator -- you’d have to use impersonation. That is, without impersonation, the application user must be the one who is assigned to the task.
    • In Project Server 2010, you can use the new ResID attribute for the Assn element in the changeXml string parameter for UpdateStatus, which enables you to avoid impersonation.
    • The application user must have the StatusBrokerPermission global permission, to be able to update data for another user.
      The changeXml string parameter for UpdateStatus can be tricky to create. For a tool to create it, see How to: Generate ChangeXML for Statusing Updates, and get the tool and source in the Project 2007 SDK download (as is, the 2007 tool does not create the new ResID attribute).
    • The ChangeList schema is a little different in Project Server 2010, from 2007 – new attributes are ResID and ChangeNumber.
    • However, UpdateStatus does not work for changes to a task for another user. That is, the changeXml parameter works for assignment fields, but not for task fields for different users. See Supported Project Fields and Field Information for Statusing ChangeXML.

    So, your existing application should be changed. Because of the switch to claims authentication and the WCF infrastructure, ASMX-based impersonation no longer works the same way. The application no longer needs to use impersonation, if you update the changeXml parameter and assign the StatusBrokerPermission perm to the user.

    --Jim

    • Marked as answer by Jim Corbin Saturday, July 10, 2010 5:17 PM
    Saturday, July 10, 2010 5:16 PM
  • Hi Jim,

    What you described in the answer is exactly what I'm trying to do in my application but it isn't working. This is the code:

    changeXml.Append("<Changes>");
     changeXml.Append("<Proj ID=\"" + projectGUID.ToString() + "\">");
     changeXml.Append("<Assn ID=\"CA669AEB-F00E-4A69-B06B-BEA3F5180420\" ResID= \"97BAB1D2-6177-4991-BA35-6244F90995A0\">");
     changeXml.Append("<PeriodChange PID=\"" + pidActualWrk + "\" Start=\"" + startDate + "\" End=\"" + endDate + "\">" + workTime.ToString() + "</PeriodChange>");
     changeXml.Append("</Assn>");
     changeXml.Append("</Proj>");
     changeXml.Append("</Changes>");

     statusing.UpdateStatus(changeXml.ToString()); 
     statusing.SubmitStatusForResource(resourceGUID,assignmentGUID,"");

    The ResID is the resource ID of the resource i'm trying to change the timephased data on behalf of. The assignment ID is the assignment ID of the ResID and the task. However, I always get the InvalidAssignmentGUID error. I can't figure out what is wrong since the assignment and resource IDs are correct. I didn't do anything regarding the statusbrokerpermission.. can this be the problem? if yes please advise how to use the statusbrokerpermission since I can't find any proper document explaining the use of the statusbrokerpermission or how to assign it to a user.

    Thanks, George

    Monday, January 24, 2011 7:27 AM