private WSDLBinding generateBinding(
WSDLComponentFactory wsdlComponentFactory, WSDLInterface portType,
QName bindingName, String style, String use, String trsportURI,
String namespeceURI) {
WSDLBinding binding = wsdlComponentFactory.createBinding();
ExtensionFactory extensionFactory = wsdlComponentFactory
.createExtensionFactory();
binding.setBoundInterface(portType);
binding.setName(bindingName);
PolicyInclude include;
ArrayList policyElementsList;
include = axisService.getPolicyInclude();
// adding policies defined in services.xml
policyElementsList = include
.getPolicyElements(PolicyInclude.AXIS_SERVICE_POLICY);
addPolicyAsExtElements(womDescription, policyElementsList, binding,
include);
// adding policies defined in wsdl:binding
policyElementsList = include
.getPolicyElements(PolicyInclude.BINDING_POLICY);
addPolicyAsExtElements(womDescription, policyElementsList, binding,
include);
SOAPBinding soapbindingImpl = (SOAPBinding) extensionFactory
.getExtensionElement(ExtensionConstants.SOAP_11_BINDING);
soapbindingImpl.setStyle(style);
soapbindingImpl.setTransportURI(trsportURI);
binding.addExtensibilityElement(soapbindingImpl);
Iterator op_itr = portType.getOperations().keySet().iterator();
while (op_itr.hasNext()) {
String opName = (String) op_itr.next();
WSDLOperation wsdlOperation = portType.getOperation(opName);
MessageReference inMessage = wsdlOperation.getInputMessage();
WSDLBindingOperation bindingoperation = wsdlComponentFactory
.createWSDLBindingOperation();
bindingoperation.setName(new QName(opName));
bindingoperation.setOperation(wsdlOperation);
AxisOperation axisOperation = axisService.getOperation(new QName(
opName));
include = axisOperation.getPolicyInclude();
// adding policies defined in operation element in services.xml
policyElementsList = include
.getPolicyElements(PolicyInclude.AXIS_OPERATION_POLICY);
addPolicyAsExtElements(womDescription, policyElementsList,
bindingoperation, include);
// adding policies defined in wsdl:binding -> wsdl:operation
policyElementsList = include
.getPolicyElements(PolicyInclude.BINDING_OPERATION_POLICY);
addPolicyAsExtElements(womDescription, policyElementsList,
bindingoperation, include);
binding.addBindingOperation(bindingoperation);
SOAPOperation soapOpimpl = (SOAPOperation) extensionFactory
.getExtensionElement(ExtensionConstants.SOAP_11_OPERATION);
soapOpimpl.setStyle(style);
// to do heve to set a proper SOAPAction