}
private List<ServiceInfo> buildServices(Definition def, Service serv, DescriptionInfo d) {
Map<QName, ServiceInfo> services = new LinkedHashMap<QName, ServiceInfo>();
DescriptionInfo description = d;
if (null == description) {
description = new DescriptionInfo();
description.setProperty(WSDL_DEFINITION, def);
description.setName(def.getQName());
description.setBaseURI(def.getDocumentBaseURI());
copyExtensors(description, def.getExtensibilityElements());
copyExtensionAttributes(description, def);
}
for (Port port : cast(serv.getPorts().values(), Port.class)) {
Binding binding = port.getBinding();
PortType bindingPt = binding.getPortType();
//TODO: wsdl4j's bug. if there is recursive import,
//wsdl4j can not get operation input message
PortType pt = def.getPortType(bindingPt.getQName());
if (pt == null) {
pt = bindingPt;
}
ServiceInfo service = services.get(pt.getQName());
if (service == null) {
service = new ServiceInfo();
service.setDescription(description);
description.getDescribed().add(service);
service.setProperty(WSDL_DEFINITION, def);
service.setProperty(WSDL_SERVICE, serv);
getSchemas(def, service);
service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);