int offset = 0;
if (paramtype == OUT_PARAM) {
offset = 1;
}
TypeCreator typeCreator = tm.getTypeCreator();
if (type == null) {
OperationInfo op = param.getMessageInfo().getOperation();
Method m = getMethod(s, op);
AbstractTypeCreator.TypeClassInfo info;
if (paramtype != FAULT_PARAM && m != null) {
info = typeCreator.createClassInfo(m, param.getIndex() - offset);
} else {
info = typeCreator.createBasicClassInfo(param.getTypeClass());
}
if (param.getMessageInfo().getOperation().isUnwrapped() && param.getTypeClass().isArray()) {
// The service factory expects arrays going into the wrapper to
// be
// mapped to the array component type and will then add
// min=0/max=unbounded. That doesn't work for Aegis where we
// already created a wrapper ArrayType so we'll let it know we
// want the default.
param.setProperty("minOccurs", "1");
param.setProperty("maxOccurs", "1");
param.setProperty("nillable", Boolean.TRUE);
}
if (info.getMappedName() != null) {
param.setConcreteName(info.getMappedName());
param.setName(info.getMappedName());
}
type = typeCreator.createTypeForClass(info);
// We have to register the type if we want minOccurs and such to
// work.
if (info.nonDefaultAttributes()) {
tm.register(type);
}