Problem:
Orginal Test Definition:

Copied Test Definition:

How can I ensure that when copying Test Definitions via the Web Services, that parameters are inherited rather than recreated on the new Test Definition?
Resolution:
To ensure that parameters remain inherited, we must remove any "parameter PropertyValue" objects from the TestPlanningNodes property values. The following code demonstrates a simplistic approach of performing the said operation:
public static void copyNodeWithoutParameters(){
try{
SccsystemSoapBindingStub sccBind = (SccsystemSoapBindingStub) new SystemServiceServiceLocator().getsccsystem(new URL("http://bel-robertm7:19120/Services1.0/services/sccsystem?wsdl"));
long lSession = sccBind.logonUser("admin", "admin");
TmplanningSoapBindingStub plnBind = (TmplanningSoapBindingStub) new PlanningServiceServiceLocator().gettmplanning(new URL("http://bel-robertm7:19120/Services1.0/services/tmplanning?wsdl"));
plnBind.setCurrentProject(lSession, "0");
//Get the TestDefinition to copy and its PropertyValues
TestPlanningNode test = plnBind.getNode(lSession, "112");
PropertyValue[] props = test.getPropertyValues();
//Create a Testplanning node that will contain the information to copy
TestPlanningNode copyTo = new TestPlanningNode();
ArrayList copyProps = new ArrayList();
for(int i=0; i<>length; i ){
//If the PropertValue is not a paramater
if(!props.getPropertyID().contains("_parameter_")){
//Add the PropertyValue to the PropertValue's to be copied
copyProps.add(props);
}
}
PropertyValue[] copy = new PropertyValue[copyProps.size()];
copyProps.toArray(copy);
//Set the PropertyValue's for the new TestDefinition minus the paramaters
copyTo.setPropertyValues(copy);
//Set the type to TestDefinition
copyTo.setKind(3);
//Add the copied node to the Testplan
plnBind.addNode(lSession, 111, copyTo, false);
}
catch(Exception e){
e.printStackTrace();
}
}