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);
binding.addBindingOperation(bindingoperation);
SOAPOperation soapOpimpl = (SOAPOperation) extensionFactory.getExtensionElement(
ExtensionConstants.SOAP_11_OPERATION);
soapOpimpl.setStyle(style);
//to do heve to set a proper SOAPAction
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);
//todo need to fix this
requestSoapbody.setNamespaceURI(namespeceURI);
bindingInMessage.addExtensibilityElement(requestSoapbody);
}
MessageReference outMessage = wsdlOperation.getOutputMessage();
if (outMessage != null) {
WSDLBindingMessageReference bindingOutMessage = wsdlComponentFactory.createWSDLBindingMessageReference();
bindingOutMessage.setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
bindingoperation.setOutput(bindingOutMessage);