for (Port port : cast(serv.getPorts().values(), Port.class)) {
if (endpointName != null
&& !endpointName.getLocalPart().equals(port.getName())) {
continue;
}
Binding binding = port.getBinding();
PortType bindingPt = binding.getPortType();
if (bindingPt == null) {
org.apache.cxf.common.i18n.Message msg = new
org.apache.cxf.common.i18n.Message("BINDING_MISSING_TYPE",
LOG,
binding.getQName());
throw new WSDLRuntimeException(msg);
}
//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);
if (recordOriginal) {
service.setProperty(WSDL_DEFINITION, def);
service.setProperty(WSDL_SERVICE, serv);
}
getSchemas(def, service);
service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
service.setTargetNamespace(def.getTargetNamespace());
service.setName(serv.getQName());
copyExtensors(service, serv.getExtensibilityElements());
copyExtensionAttributes(service, serv);
buildInterface(service, pt);
services.put(pt.getQName(), service);
}
BindingInfo bi = service.getBinding(binding.getQName());
if (bi == null) {
bi = buildBinding(service, binding);
}
buildEndpoint(service, bi, port);
}