* if a problem occurs
*/
void addModuleOperations(AxisModule module) throws AxisFault {
HashMap<QName, AxisOperation> map = module.getOperations();
Collection<AxisOperation> col = map.values();
PhaseResolver phaseResolver = new PhaseResolver(getAxisConfiguration());
for (Iterator<AxisOperation> iterator = col.iterator(); iterator.hasNext();) {
AxisOperation axisOperation = copyOperation((AxisOperation) iterator
.next());
if (this.getOperation(axisOperation.getName()) == null) {
ArrayList<String> wsamappings = axisOperation.getWSAMappingList();
if (wsamappings != null) {
for (int j = 0, size = wsamappings.size(); j < size; j++) {
String mapping = (String) wsamappings.get(j);
//If there is already an operation with this action
//mapping (e.g. if the service has a matching operation)
//then we're going to check to see if the module's
//operation says that it's OK to be overridden and
//if so, we'll simply ignore the mapping, otherwise
//we continue as before
AxisOperation mappedOperation = getOperationByAction(mapping);
if ((mappedOperation != null)
&& (axisOperation.isParameterTrue(DeploymentConstants.TAG_ALLOWOVERRIDE))) {
if (log.isDebugEnabled()) {
log
.debug("addModuleOperations: Mapping already exists for action: "
+ mapping
+ " to operation: "
+ axisOperation
+ " named: "
+ axisOperation.getName()
+ " and an override is allowed, so the module mapping for module: "
+ module.getName()
+ " is being ignored.");
log.debug(JavaUtils.callStackToString());
}
} else {
mapActionToOperation(mapping, axisOperation);
}
}
}
// If we've set the "expose" parameter for this operation, it's
// normal (non-
// control) and therefore it will appear in generated WSDL. If
// we haven't,
// it's a control operation and will be ignored at WSDL-gen
// time.
if (axisOperation
.isParameterTrue(DeploymentConstants.TAG_EXPOSE)) {
axisOperation.setControlOperation(false);
} else {
axisOperation.setControlOperation(true);
}
phaseResolver.engageModuleToOperation(axisOperation, module);
this.addOperation(axisOperation);
}
}
}