none
Impersonation and Unhandled Communication Fault occurred RRS feed

  • General discussion

  • Hi,

    This is the code of Project server 2007 and trying to make it run inside the 2010, for impersonating a user and Approve the submitted task for the user automatically.

    Following is my Code

    while reading the submitted data I am getting this Error "Unhandled Communication Fault occurred"

    ResourceDerived resProxyBySSP = new ResourceDerived();
                StatusingDerived statsProxyBySSP = new StatusingDerived();
                System.Net.NetworkCredential mycred = new System.Net.NetworkCredential("epm.admin", "password", "Domainname");
    
                bool isWinUser = true;
                string username = "Domain\\ABC";
                Guid userId = new Guid("D6AAD44B-93CF-4F76-BC2D-19704D455247");
                Guid siteid = new Guid("81DC8139-7E5A-41EF-BB5A-2CFA1316B24F");
    
                resProxyBySSP.Url = PROJECTSERVER_WIN_URL + "resource.asmx";
                resProxyBySSP.Credentials = mycred;
    
                ResourceDerived.SetImpersonationContext(isWinUser, username, userId, Guid.Empty, siteid, "1033");
                //Guid ImpersonateUserID = resProxyBySSP.GetCurrentUserUid();
    
                statsProxyBySSP.Url = PROJECTSERVER_WIN_URL + "statusing.asmx"; ;
                statsProxyBySSP.Credentials = mycred;
    
                StatusingDerived.SetImpersonationContext(isWinUser, username, userId, Guid.Empty, siteid, "1033");
                StatusApprovalDataSet SAD = statsProxyBySSP.ReadStatusApprovalsSubmitted(false);
    
                for (int j = 0; j < SAD.StatusApprovals.Count; j++)
                {
                    SAD.StatusApprovals[j].ASSN_TRANS_ACTION_ENUM = 1;
                    break;
                }
                statsProxyBySSP.UpdateStatusApprovals(SAD);
                statsProxyBySSP.QueueApplyStatusApprovals(Guid.NewGuid(), "");


    Thanks, Parth

    Tuesday, June 11, 2013 11:09 AM