Project Management Web Services (242 Views)
Reply
Frequent Advisor
AlfredoMonasi
Posts: 75
Registered: ‎12-03-2013
Message 1 of 4 (242 Views)
Accepted Solution

Project Management Web Services

Hi everybody,

 

I'm using for the first time PPM Web Service and I have a question regardly simpleFields in the Project Management Web Services.

 

When creating a request I dont have troubles creating fields and notes using the objects SimpleFields and Notes but in the ProjectService wsdl I don't know how to create a project with the simple fields I want like in DemandServices. Notes objects are supported by ProjectType

 

createProject cp = new createProject();
cp.projectBean = new projectType();
cp.projectBean.Item = tipoProyecto;
cp.projectBean.projectName = nombreProyecto;
cp.projectBean.plannedFinishPeriodFullName = periodoI;
cp.projectBean.plannedStartPeriodFullName = periodoF;
cp.projectBean.regionName = region;
cp.projectBean.projectManagerUserName = new string[1] { projectManager };

 

ProjectService.Note[] notes = new ProjectService.Note[indNotas];
//Indice 1
notes[0] = new ProjectService.Note();
notes[0].author = ConfigurationManager.AppSettings["userPPM"].ToString();
notes[0].content = "Actualización desde WebService";
notes[0].creationDate = DateTime.Now;
notes[0].creationDateSpecified = true;

if (!nota.Equals(String.Empty))
{
notes[1] = new ProjectService.Note();
notes[1].author = ConfigurationManager.AppSettings["userPPM"].ToString();
notes[1].content = nota;
notes[1].creationDate = DateTime.Now;
notes[1].creationDateSpecified = true;
}

cp.projectBean.notes = notes;

 

Do I miss something or should I need to use the DemandService to update the fields?

 

Regards

 

Alfredo

Please use plain text.
Honored Contributor
Utkarsh_Mishra
Posts: 686
Registered: ‎07-13-2010
Message 2 of 4 (220 Views)

Re: Project Management Web Services

Once the Project us created, you need to use seperate Demand service to update the Project Request ID.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Please use plain text.
Frequent Advisor
AlfredoMonasi
Posts: 75
Registered: ‎12-03-2013
Message 3 of 4 (194 Views)

Re: Project Management Web Services

Hi Utkarsh,

 

Thanks for your reply, I have another question, now regarding creating workplan template or creating Blank Work Plan, this object use workPlanInputType instead projectInputType but what I see is that I cannot specified to use the project ID instead the Project Name, there is no ItemElementName object for the input type.

 

I'm using PPM 9.22, is this normal or is something related to the version?

 

Regards

 

Alfredo

Please use plain text.
Honored Contributor
Utkarsh_Mishra
Posts: 686
Registered: ‎07-13-2010
Message 4 of 4 (188 Views)

Re: Project Management Web Services

[ Edited ]

The WordPlanInputType data type is typically used for operations on a project’s work plan.

 

You can either specify the projectName property or the projectId property, but not both of them. Neither
of these properties is “required,” but at least one must be specified.

 

Below is the code to set Project ID in workplaninputtype.

 

private void createBlankWorkPlan(Long projectID) throws RemoteException {		
		//Create inpput document
		CreateBlankWorkPlanDocument crtblkWpDoc = CreateBlankWorkPlanDocument.Factory.newInstance();
		
		//create and add an empty CreateBlankWorkPlan element
		CreateBlankWorkPlan cbwp = crtblkWpDoc.addNewCreateBlankWorkPlan();
		
		//Create and add an empty WorkPlanInputType element
		WorkPlanInputType wpit = cbwp.addNewProjectInput();
		
		//Set the value for this element
		wpit.setProjectId(projectID);
		
		//Calling web service 
		ProjectServiceStub stub = new ProjectServiceStub(ctx, WSURL);
		stub.createBlankWorkPlan(crtblkWpDoc);
	}

 

 

 

Secondly if you want you can easily use Project Name, as PPM does not allow duplicate Project Name in the system.

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation