/*
* Input
*/
ParameterContextImpl inputParam = new ParameterContextImpl();
ServiceDescriptionType serviceDescriptionType = serviceDescription.getType();
for (Parameter parameter : serviceDescriptionType.getInputParametersArray()) {
OMElement element = input.getFirstChildWithName(new QName(null,parameter.getParameterName()));
if (element == null) {
throw new Exception("Parameter is not found in the message");
}
//todo this implementation doesn't work when there are n number of nodes connecting .. need to fix
// String xmlContent = "";
// if(!element.getChildElements().hasNext()){
// xmlContent = "<type:GFacParameter xsi:type=\"type:" + MappingFactory.getActualParameterType(parameter.getParameterType().getType())
// +"\" xmlns:type=\"http://schemas.airavata.apache.org/gfac/type\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" + element.getText() + "</type:GFacParameter>";
// }else{
// xmlContent = "<type:GFacParameter xsi:type=\"type:" + MappingFactory.getActualParameterType(parameter.getParameterType().getType())
// +"\" xmlns:type=\"http://schemas.airavata.apache.org/gfac/type\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" + element.toStringWithConsume() + "</type:GFacParameter>";
// }
// System.out.println(xmlContent);
// inputParam.add(parameter.getParameterName(),ActualParameter.fromXML(xmlContent));
ActualParameter actualParameter = getInputActualParameter(parameter, element);
inputParam.add(parameter.getParameterName(),actualParameter);
}
/*
* Output
*/
ParameterContextImpl outputParam = new ParameterContextImpl();
// List<Parameter> outputs = serviceDescription.getOutputParameters();
for (OutputParameterType parameter : serviceDescriptionType.getOutputParametersArray()) {
ActualParameter actualParameter = new ActualParameter();
if("String".equals(parameter.getParameterType().getName())){
actualParameter.getType().changeType(StringParameterType.type);
}else if("Double".equals(parameter.getParameterType().getName())){
actualParameter.getType().changeType(DoubleParameterType.type);