locked
PSI unhandled communication fault occurred RRS feed

  • Question

  •         public void UpdataProjectTemp(Guid ProjectUid, string ProjectName, string ResourceUID)
            {
                projectSvc.Credentials = new System.Net.NetworkCredential("admin", "admin", "lc.com");
                queueSystemSvc.Credentials = new System.Net.NetworkCredential("admin", "admin", "lc.com");
                projectSvc.Url = ("http://a0002-02091/PWA/_vti_bin/PSI/project.asmx");
                queueSystemSvc.Url = ("http://a0002-02091/PWA/_vti_bin/PSI/queuesystem.asmx");
    
    
                //更新任务
                ProjectWebSvc.ProjectDataSet projectDs = new ProjectWebSvc.ProjectDataSet();
                projectDs = projectSvc.ReadProject(ProjectUid, ProjectWebSvc.DataStoreEnum.WorkingStore);
    
    
                //check out the project data
                try
                {
                    projectSvc.CheckOutProject(ProjectUid, sessionUid, session_desc);
    
    
    
    
                    if (ProjectName != null)
                    {
                        //ProjectWebSvc.ProjectDataSet.ProjectRow project = projectDs.Project.FindByPROJ_UID(ProjectUid);
                        //project.PROJ_NAME = ProjectName;
                    }
                    if (ResourceUID != null)
                    {
                        ProjectWebSvc.ProjectDataSet.ProjectRow project = projectDs.Project.FindByPROJ_UID(ProjectUid);
    
    
                        project.ProjectOwnerID = new Guid(ResourceUID);
    
                    }
    
                    //ProjectWebSvc.ProjectDataSet.ProjectResourceRow resource = projectDs.ProjectResource.FindByRES_UIDPROJ_UID(ResUid, ProjectUid);
    
    
                    //Update the project
                    Guid jobId = Guid.NewGuid();
                    projectSvc.QueueUpdateProject(jobId, sessionUid, projectDs, false);
                    this.psiWaitForQueue(queueSystemSvc, jobId);
                }
    
    
    
    
                catch (Exception ex)
                {
                    //WriteLog.recordLog("调用PSI的函数UpdataProjectTemp报错");
                    Console.Write(ex.Message);
                }
                finally
                {
                    ////Check in the project
                    bool isForceCheckIn = true;
                    Guid jobId1 = Guid.NewGuid();
                    projectSvc.QueueCheckInProject(jobId1, ProjectUid, isForceCheckIn, sessionUid, session_desc);
                    this.psiWaitForQueue(queueSystemSvc, jobId1);
    
                    //// Publish the project.
                    Guid jobId2 = Guid.NewGuid();
                    projectSvc.QueuePublish(jobId2, ProjectUid, false, String.Empty);
                    this.psiWaitForQueue(queueSystemSvc, jobId2);
    
                    //return "success";
                }
    
                Console.Write("aaaa");
                Console.ReadKey();
            }

    This is my code to call psi to change projetctmanager .but when the code run to 

    projectSvc.QueueCheckInProject(jobId1, ProjectUid, isForceCheckIn, sessionUid, session_desc);

    it's error,the error information is "unhandled communication fault occurred"

    but the code  run success when the project is small and simple.

    There are 450 tasks in the error project,this is very important project,who can tell me how to resolve it?

    Thanks All.


    • Edited by oulei2008 Saturday, March 23, 2013 9:03 AM sss
    Saturday, March 23, 2013 8:59 AM

All replies

  • Why no Answer?
    Tuesday, April 2, 2013 8:59 AM
  • Does your user have appropriate permissions in Project Server?

    These are the permissions he must have:

    http://www.projectserver2010blog.com/2010/01/projectserver-2010-workflow-accessing.html

    (also put him in administrators group in Project Server).

    Are you using claims based authentication?

    Wednesday, April 3, 2013 7:23 AM
  • Or you can try enabling/disabling Anonymous Authentication on IIS for that Web Application.
    Thursday, April 4, 2013 7:39 AM