public BindingOperation createBindingOperation(Definition definition, Operation operation, String action)
throws WSDLException {
BindingOperation bindingOperation = definition.createBindingOperation();
bindingOperation.setOperation(operation);
configureBindingOperation(bindingOperation, operation);
ExtensibilityElement operationExtension =
definition.getExtensionRegistry().createExtension(BindingOperation.class, soapOperation);
if (requiresSOAP12) {
((SOAP12Operation)operationExtension).setSoapActionURI(action);
} else {
((SOAPOperation)operationExtension).setSoapActionURI(action);
}
bindingOperation.addExtensibilityElement(operationExtension);
if (operation.getInput() != null) {
BindingInput bindingInput = definition.createBindingInput();
configureBindingInput(bindingInput, operation.getInput());
ExtensibilityElement inputExtension =
definition.getExtensionRegistry().createExtension(BindingInput.class, soapBody);
if (requiresSOAP12) {
((SOAP12Body)inputExtension).setUse("literal");
} else {
((SOAPBody)inputExtension).setUse("literal");
}
bindingInput.addExtensibilityElement(inputExtension);
bindingOperation.setBindingInput(bindingInput);
}
if (operation.getOutput() != null) {
BindingOutput bindingOutput = definition.createBindingOutput();
configureBindingOutput(bindingOutput, operation.getOutput());
ExtensibilityElement outputExtension =
definition.getExtensionRegistry().createExtension(BindingOutput.class, soapBody);
if (requiresSOAP12) {
((SOAP12Body)outputExtension).setUse("literal");
} else {
((SOAPBody)outputExtension).setUse("literal");
}
bindingOutput.addExtensibilityElement(outputExtension);
bindingOperation.setBindingOutput(bindingOutput);
}
for (Iterator fi = operation.getFaults().values().iterator(); fi.hasNext();) {
Fault fault = (Fault)fi.next();
BindingFault bindingFault = definition.createBindingFault();
ExtensibilityElement faultExtension =
definition.getExtensionRegistry().createExtension(BindingFault.class, soapFault);
configureBindingFault(bindingFault, faultExtension, fault);
bindingFault.addExtensibilityElement(faultExtension);
bindingOperation.addBindingFault(bindingFault);
}