serviceDescription.getType().setOutputParametersArray(outputParameterTypeArray);
return serviceDescription;
}
public static ServiceDescriptor createServiceDescriptor(ServiceDescription serviceDescription){
ServiceDescriptor serviceDescriptor = new ServiceDescriptor();
serviceDescriptor.setServiceName(serviceDescription.getType().getName());
serviceDescriptor.setDescription(serviceDescription.getType().getDescription());
InputParameterType[] inputParametersArray = serviceDescription.getType().getInputParametersArray();
OutputParameterType[] outputParametersArray = serviceDescription.getType().getOutputParametersArray();
List<ServiceParameters> inputParams = new ArrayList<ServiceParameters>();
List<ServiceParameters> outputParams = new ArrayList<ServiceParameters>();
for (int i = 0; i < inputParametersArray.length; i++){
ServiceParameters serviceParameters = new ServiceParameters();
serviceParameters.setType(inputParametersArray[i].getParameterType().getType().toString());
// String[] parameterValueArray = inputParametersArray[i].getParameterValueArray();
// if (parameterValueArray.length != 0){
// serviceParameters.setName(parameterValueArray[0]);
// }
serviceParameters.setName(inputParametersArray[i].getParameterName());
serviceParameters.setDescription(inputParametersArray[i].getParameterDescription());
// serviceParameters.set(inputParametersArray[i].getParameterType().getType().toString());
inputParams.add(serviceParameters);
}
serviceDescriptor.setInputParams(inputParams);
for (int i = 0; i < outputParametersArray.length; i++){
ServiceParameters serviceParameters = new ServiceParameters();
serviceParameters.setType(outputParametersArray[i].getParameterType().getType().toString());
serviceParameters.setName(outputParametersArray[i].getParameterName());
serviceParameters.setDescription(outputParametersArray[i].getParameterDescription());
// serviceParameters.setDataType(outputParametersArray[i].getParameterType().getType().toString());
outputParams.add(serviceParameters);
}
serviceDescriptor.setOutputParams(outputParams);
return serviceDescriptor;
}