use of com.ibm.lsid.wsdl.LSIDPortFactory in project cdmlib by cybertaxonomy.
the class LsidWsdlWrapperImpl method extractPorts.
/**
* Extract the port info for data and meta data
*/
private void extractPorts() throws LSIDException {
Map services = definition.getServices();
Object[] serviceKeys = services.keySet().toArray();
for (int j = 0; j < serviceKeys.length; j++) {
Service service = (Service) services.get(serviceKeys[j]);
Map ports = service.getPorts();
Object[] portKeys = ports.keySet().toArray();
// go through the ports, meta data and data
for (int i = 0; i < portKeys.length; i++) {
Port port = (Port) ports.get(portKeys[i]);
Binding binding = port.getBinding();
PortType portType = binding.getPortType();
QName qname = portType.getQName();
if (qname.getLocalPart().equals(METADATA_PORT_TYPE) && qname.getNamespaceURI().equals(OMG_LSID_PORT_TYPES_WSDL_NS_URI)) {
if (!binding.getQName().equals(METADATA_SOAP_BINDING) && !binding.getQName().equals(METADATA_HTTP_BINDING) && !binding.getQName().equals(METADATA_FTP_BINDING) && !binding.getQName().equals(METADATA_FILE_BINDING))
throw new LSIDException(LSIDException.UNKNOWN_METHOD, "Unrecognized metadata binding: " + binding.getQName());
LsidStandardPortImpl portImpl = extractPort(service, port, qname);
lsidMetadataPorts.put(portImpl.getKey(), portImpl);
} else if (qname.getLocalPart().equals(DATA_PORT_TYPE) && qname.getNamespaceURI().equals(OMG_LSID_PORT_TYPES_WSDL_NS_URI)) {
if (!binding.getQName().equals(DATA_SOAP_BINDING) && !binding.getQName().equals(DATA_HTTP_BINDING) && !binding.getQName().equals(DATA_FTP_BINDING) && !binding.getQName().equals(DATA_FILE_BINDING))
throw new LSIDException(LSIDException.UNKNOWN_METHOD, "Unrecognized data binding: " + binding.getQName());
LsidStandardPortImpl portImpl = extractPort(service, port, qname);
lsidDataPorts.put(portImpl.getKey(), portImpl);
} else if (qname.getLocalPart().equals(AUTHORITY_PORT_TYPE) && qname.getNamespaceURI().equals(OMG_LSID_PORT_TYPES_WSDL_NS_URI)) {
if (!binding.getQName().equals(AUTHORITY_SOAP_BINDING) && !binding.getQName().equals(AUTHORITY_HTTP_BINDING))
throw new LSIDException(LSIDException.UNKNOWN_METHOD, "Unrecognized authority binding: " + binding.getQName());
LsidStandardPortImpl portImpl = extractPort(service, port, qname);
lsidAuthorityPorts.put(portImpl.getKey(), portImpl);
} else {
LSIDPortFactory lpf = LSIDResolver.getConfig().getLSIDPortFactory(portType);
LSIDPort newPort = null;
if (lpf == null) {
newPort = new DefaultLSIDPort(service.getQName().getLocalPart(), port.getName(), port);
} else {
// might have to use whole qname, not sure for now
newPort = lpf.createPort(service.getQName().getLocalPart(), port);
}
wsdlExtensionPorts.put(getPortKey(newPort), newPort);
}
}
}
}
Aggregations