Created On: 21 March 2012
Problem:
Is it possible to return a list of all inactive projects via the SilkCentral Test Manager web services?
Resolution:
In the below example the list of all projects is obtained and then each project in the list is queried, if the project is inactive then the IsActive will return false and the project is added to the list of inactive projects:
public Project[] showInactiveProjects (long SessionID)
{
Project[] Projects;
int iCount = 0;
Project[] listofInactiveProjects = new Project[2];
try{
SccentitiesSoapBindingStub SccEntBind = (SccentitiesSoapBindingStub) new MainEntitiesServiceLocator
().getsccentities();
Projects = SccEntBind.getProjects(SessionID);
for (Project project : Projects) {
if (!project.isActive()){
listofInactiveProjects[iCount] = project;
iCount ;
}
}
return listofInactiveProjects;
}
catch(Exception e){
e.printStackTrace();
return listofInactiveProjects;
}
}