Definition portTypeWSDL) throws AxisFault {
Map wsdl4jPorts = wsdl4jService.getPorts();
QName bindingName = binding.getQName();
Port port;
AxisEndpoint axisEndpoint = null;
processedBindings = new HashMap();
// process the port type for this binding
// although we support multiports they must be belongs to same port type and should have the
// same soap style
populatePortType(portType, portTypeWSDL);
Binding currentBinding;
Definition currentBindingWSDL = null;
for (Iterator iterator = wsdl4jPorts.values().iterator(); iterator.hasNext();) {
port = (Port) iterator.next();
// if the user has picked a port then we have to process only that port
if ((this.portName == null) || (this.portName.equals(port.getName()))) {
// we process the port only if it has the same port type as the selected binding
currentBindingWSDL = getParentDefinition(wsdl4jDefinition,
port.getBinding().getQName(), COMPONENT_BINDING, new HashSet());
currentBinding = currentBindingWSDL.getBinding(port.getBinding().getQName());
if (currentBinding.getPortType().getQName().equals(binding.getPortType().getQName())) {
axisEndpoint = new AxisEndpoint();
axisEndpoint.setName(port.getName());
if (axisService.getEndpointName() == null &&
bindingName.equals(port.getBinding().getQName())) {
populateEndpoint(axisEndpoint, port, currentBinding,
bindingWSDL, portType, portTypeWSDL, true);
axisService.setEndpointName(axisEndpoint.getName());
axisService.setBindingName(axisEndpoint.getBinding().getName().getLocalPart());
} else {
populateEndpoint(axisEndpoint, port, currentBinding,
bindingWSDL, portType, portTypeWSDL, false);
}
axisEndpoint.setParent(axisService);
axisService.addEndpoint(port.getName(), axisEndpoint);
}
}
}
}