For creating a project you have to use “_vti_bin/psi/Project.asmx” web service.
To use any PSI web service first you have to login to the server. Check my previous post
Project server has predefined database structure.
So for creating a new project we need t o create a new row in project table.
This row has many columns but only few are required for input and others are non mandatory or filled atomically.
Here are that fields
PROJ_UID : new GUID for project.
PROJ_NAME : name of the project which should be unique.
PROJ_INFO_START_DATE : it is not mendatory but every project must have start date other wuse it will take system date.
PROJ_TYPE : this is important. There are two type of porject in project server one is project and other is Template. For project its value is 0 and for template its value is 1. So we are using 0 as we are creating a project.
then this field value in row we have to add this row in project table.
After that project.asmx have a method called QueueCreateProject.
This method will create a project in draft database and push the argument in Project server Queue.
After generating project in draft database we need to publish that project.
For publishing project we have to call QueuePublish method from Project.asmx
Note: Only published project is available to user in PWA.
And last operation after publishing project we need to do is “check in the project”
Checked out project is visible to user but cannot be editable by any one. For check in the project there is also another method in project.asmx QueueCheckInProject
And as per experienced developer we have to logofffrom PSI server.
Here is the snippet for creating project in project server (PWA).
private WebSvcProject.ProjectDataSet dsProjectDataSet = null;
private Project objProject = null;
private bool CreateProject()
//for creating a new we need to create a new row in project table of project dataset
WebSvcProject.ProjectDataSet.ProjectRow projectRow = dsProjectDataSet.Project.NewProjectRow();
Guid _projectGUID = Guid.NewGuid(); // new GUID for each project
projectRow.PROJ_UID = _projectGUID;
projectRow.PROJ_NAME = "My new Project";
projectRow.PROJ_INFO_START_DATE = System.DateTime.Now;
projectRow.PROJ_TYPE = 0; //0 is for project and 1 is for template
//create a project using project.asmx
//after creating project by default it is in draft
//we must have to publish the project
objProject.QueuePublish(Guid.NewGuid(), _projectGUID, true, string.Empty);
//when project is created bu default it is checked out
// we must checkin the project.
objProject.QueueCheckInProject(Guid.NewGuid(), _projectGUID, true, Guid.Empty, "Checking by system");
catch (Exception ex)