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.