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
ArrayList wsamappingList = axisOperation.getWsamappingList();
if (wsamappingList != null && wsamappingList.size() > 0) {
soapOpimpl.setSoapAction((String) wsamappingList.get(0));
} else {
soapOpimpl.setSoapAction(opName);
}
bindingoperation.addExtensibilityElement(soapOpimpl);
if (inMessage != null) {
WSDLBindingMessageReference bindingInMessage = wsdlComponentFactory
.createWSDLBindingMessageReference();
bindingInMessage
.setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
bindingoperation.setInput(bindingInMessage);
SOAPBody requestSoapbody = (SOAPBody) extensionFactory
.getExtensionElement(ExtensionConstants.SOAP_11_BODY);
requestSoapbody.setUse(use);
requestSoapbody.setNamespaceURI(namespeceURI);
bindingInMessage.addExtensibilityElement(requestSoapbody);
AxisMessage axisInMessage = axisOperation
.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
include = axisInMessage.getPolicyInclude();
// adding policies defined in message element in services.xml
policyElementsList = include
.getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
addPolicyAsExtElements(womDescription, policyElementsList,
inMessage, include);
// adding policies defined in wsdl:binding -> wsdl:operation ->
// wsdl:input
policyElementsList = include
.getPolicyElements(PolicyInclude.BINDING_INPUT_POLICY);
addPolicyAsExtElements(womDescription, policyElementsList,
inMessage, include);
}
MessageReference outMessage = wsdlOperation.getOutputMessage();
if (outMessage != null) {
WSDLBindingMessageReference bindingOutMessage = wsdlComponentFactory
.createWSDLBindingMessageReference();
bindingOutMessage
.setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
bindingoperation.setOutput(bindingOutMessage);
SOAPBody resSoapbody = (SOAPBody) extensionFactory
.getExtensionElement(ExtensionConstants.SOAP_11_BODY);
resSoapbody.setUse(use);
resSoapbody.setNamespaceURI(namespeceURI);
bindingOutMessage.addExtensibilityElement(resSoapbody);