for (ServiceInfo service : services) {
Definition portTypeDef = definition;
if (!isSameTNS(service)) {
portTypeDef = newDefinition(service.getInterface().getName(),
service.getInterface().getName().getNamespaceURI());
Import wsdlImport = definition.createImport();
String tns = service.getInterface().getName().getNamespaceURI();
wsdlImport.setDefinition(portTypeDef);
wsdlImport.setNamespaceURI(tns);
wsdlImport.setLocationURI(service.getInterface().getName().getLocalPart() + ".wsdl");
definition.addImport(wsdlImport);
addNamespace(getPrefix(tns), tns, definition);
}
portTypes.add(buildPortType(service.getInterface(), portTypeDef));