String serviceName = desc.getWebserviceDescriptionName().getValue();
for (PortComponentType port : desc.getPortComponent()) {
PortInfo portInfo = new PortInfo();
String serviceLink = null;
ServiceImplBeanType beanType = port.getServiceImplBean();
if (beanType.getEjbLink() != null) {
serviceLink = beanType.getEjbLink().getValue();
} else if (beanType.getServletLink().getValue() != null) {
serviceLink = beanType.getServletLink().getValue();
}
portInfo.setServiceLink(serviceLink);
if (port.getServiceEndpointInterface() != null) {
String sei = port.getServiceEndpointInterface().getValue();
portInfo.setServiceEndpointInterfaceName(sei);
}
String portName = port.getPortComponentName().getValue();
portInfo.setPortName(portName);
portInfo.setProtocolBinding(port.getProtocolBinding());
portInfo.setServiceName(serviceName);
portInfo.setWsdlFile(wsdlFile);
if (port.getEnableMtom() != null) {
portInfo.setEnableMTOM(port.getEnableMtom().isValue());
}
portInfo.setHandlers(HandlerChainsType.class, port.getHandlerChains());
if (port.getWsdlPort() != null) {
portInfo.setWsdlPort(port.getWsdlPort().getValue());
}
if (port.getWsdlService() != null) {
portInfo.setWsdlService(port.getWsdlService().getValue());
}
String location = (String) correctedPortLocations.get(serviceLink);
portInfo.setLocation(location);
if (map == null) {
map = new HashMap<String, PortInfo>();
}
map.put(serviceLink, portInfo);