public void init(CodeGenConfiguration configuration) {
this.configuration = configuration;
}
public void engage() {
WSDLDescription wom = this.configuration.getWom();
Map bindingMap = wom.getBindings();
Vector bindingVector = new Vector();
if (bindingMap==null || bindingMap.isEmpty()) {
log.info(" bindings are not present in the original document");
//just fall through
}else{
Collection bindingCollection = bindingMap.values();
for (Iterator iterator = bindingCollection.iterator(); iterator.hasNext();) {
WSDLBinding binding = (WSDLBinding)iterator.next();
WSDLBinding newBinding = wom.createBinding();
newBinding.setName(AXIS_BINDING_QNAME);
WSDLInterface boundInterface = binding.getBoundInterface();
newBinding.setBoundInterface(boundInterface);
newBinding.setBindingFaults(binding.getBindingFaults());
newBinding.setBindingOperations(binding.getBindingOperations());
Iterator elementIterator = binding.getExtensibilityElements().iterator();
while (elementIterator.hasNext()) {
newBinding.addExtensibilityElement(
(WSDLExtensibilityElement) elementIterator.next());
}
Iterator attributeIterator = binding.getExtensibilityAttributes()
.iterator();
while (attributeIterator.hasNext()) {
newBinding.addExtensibleAttributes(
(WSDLExtensibilityAttribute) attributeIterator.next());
}
bindingVector.add(newBinding);
}
//drop all the bindings and add the new ones
wom.getBindings().clear();
for (int i = 0; i < bindingVector.size(); i++) {
wom.addBinding ((WSDLBinding) bindingVector.get(i));
}
}
}