none
can not use PSI to create project in epm when using form authentication ?! RRS feed

  • 问题

  • hi,

           I have a question: i can not use PSI create project in epm when using form authentication ?! It works when using windows authentication.

          my code:

    ProjectWebSvc.Project projectSvc = new ProjectWebSvc.Project();

        ProjectSvc.Credentials = CredentialCache.DefaultCredentials;

        QueueSystemWebSvc.QueueSystem queueSystemSvc = new QueueSystemWebSvc.QueueSystem();

        QueueSystemSvc.Credentials = CredentialCache.DefaultCredentials;

           ProjectWebSvc.ProjectDataSet projectDs = new ProjectWebSvc.ProjectDataSet();

     

           Guid ProjectUid = Guid.NewGuid();

     

                    // Create the project.

                    ProjectWebSvc.ProjectDataSet.ProjectRow projectRow = projectDs.Project.NewProjectRow();

                    projectRow.PROJ_UID = ProjectUid;

                    projectRow.PROJ_NAME = "PSI创建测试项目-" + txtProjectName.Text.Trim();

                    projectRow.PROJ_TYPE = (int)PSLib.Project.ProjectType.Project;

                  

                    projectDs.Project.AddProjectRow(projectRow);

     

                    // Save the project to the database.

                    Guid jobId = Guid.NewGuid();

                    projectSvc.QueueCreateProject(jobId, projectDs, false);    

                    this.psiWaitForQueue(queueSystemSvc, jobId);

                    btnImport.Text = "Save OK";

     

                    // Publish the project

                    Guid jobId2 = Guid.NewGuid();

                    projectSvc.QueuePublish(jobId2, ProjectUid, false, String.Empty);

                    this.psiWaitForQueue(queueSystemSvc, jobId2);

     


    peardong
    2011年2月25日 8:19

答案

全部回复