return orderedParameters;
}
protected MessageContentsList getParameters(Message message, BindingOperationInfo operation) {
MessageContentsList parameters = new MessageContentsList();
Map<String, String> queries = getQueries(message);
if (!isFixedParameterOrder(message)) {
boolean emptyQueries = CollectionUtils.isEmpty(queries.values());
List<String> names = ServiceModelUtil.getOperationInputPartNames(operation.getOperationInfo());
queries = keepInOrder(queries,
operation.getOperationInfo(),
names);
if (!emptyQueries && CollectionUtils.isEmpty(queries.values())) {
if (operation.isUnwrappedCapable()) {
//maybe the wrapper was skipped
return getParameters(message, operation.getUnwrappedOperation());
}
throw new Fault(new org.apache.cxf.common.i18n.Message("ORDERED_PARAM_REQUIRED",
LOG,
names.toString()));
}
}
Method method = getMethod(message, operation);
Class<?>[] types = method.getParameterTypes();
for (Map.Entry<String, String> ent : queries.entrySet()) {
String key = ent.getKey();
MessagePartInfo inf = null;
for (MessagePartInfo p : operation.getOperationInfo().getInput().getMessageParts()) {
if (p.getConcreteName().getLocalPart().equals(key)) {
inf = p;
break;
}
}
if (inf == null && operation.isUnwrappedCapable()) {
for (MessagePartInfo p
: operation.getUnwrappedOperation().getOperationInfo().getInput().getMessageParts()) {
if (p.getConcreteName().getLocalPart().equals(key)) {
inf = p;
break;
}
}
}
int idx = 0;
if (inf != null) {
idx = inf.getIndex();
}
Class<?> type = types[idx];
if (type == null) {
LOG.warning("URIMappingInterceptor MessagePartInfo NULL ");
throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", LOG,
"index: " + idx + " on key " + key));
}
// TODO check the parameter name here
Object param = null;
String val = ent.getValue();
if (type.isPrimitive() && val != null) {
param = PrimitiveUtils.read(val, type);
} else {
param = readType(val, type);
}
parameters.set(idx, param);
idx = parameters.size();
}
return parameters;
}