use of com.ibm.wsdl.extensions.ftp.FTPLocationImpl in project cdmlib by cybertaxonomy.
the class LsidWsdlWrapperImpl method createPort.
/**
* Create a port for the given binding, protocol, hostname, port and name.
* In the case of some protocols, the hostname might be the entire endpoing, (for SOAP this is the case).
* If the portname is null, then a default name for the given protocol is chosen.
*/
public Port createPort(Binding binding, LSIDStandardPort port) {
Port newPort = definition.createPort();
newPort.setBinding(binding);
String portName = port.getName();
String protocol = port.getProtocol();
if (portName == null)
portName = newPortName(protocol);
newPort.setName(portName);
if (protocol.equals(HTTP)) {
HTTPAddress addr = new HTTPAddressImpl();
addr.setLocationURI(port.getLocation());
newPort.addExtensibilityElement(addr);
} else if (protocol.equals(FTP)) {
FTPLocation loc = new FTPLocationImpl(port.getLocation(), port.getPath());
newPort.addExtensibilityElement(loc);
} else if (protocol.equals(FILE)) {
FileLocation loc = new FileLocationImpl(port.getLocation());
newPort.addExtensibilityElement(loc);
} else if (protocol.equals(SOAP)) {
SOAPAddress addr = new SOAPAddressImpl();
addr.setLocationURI(port.getLocation());
newPort.addExtensibilityElement(addr);
}
return newPort;
}
Aggregations