Search in sources :

Example 1 with FileLocationImpl

use of com.ibm.wsdl.extensions.file.FileLocationImpl 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;
}
Also used : SOAPAddressImpl(com.ibm.wsdl.extensions.soap.SOAPAddressImpl) FileLocationImpl(com.ibm.wsdl.extensions.file.FileLocationImpl) HTTPAddress(javax.wsdl.extensions.http.HTTPAddress) FTPLocationImpl(com.ibm.wsdl.extensions.ftp.FTPLocationImpl) HTTPAddressImpl(com.ibm.wsdl.extensions.http.HTTPAddressImpl) LSIDPort(com.ibm.lsid.wsdl.LSIDPort) LSIDDataPort(com.ibm.lsid.wsdl.LSIDDataPort) DefaultLSIDPort(com.ibm.lsid.wsdl.DefaultLSIDPort) LSIDStandardPort(com.ibm.lsid.wsdl.LSIDStandardPort) Port(javax.wsdl.Port) LSIDMetadataPort(com.ibm.lsid.wsdl.LSIDMetadataPort) LSIDAuthorityPort(com.ibm.lsid.wsdl.LSIDAuthorityPort) FileLocation(com.ibm.wsdl.extensions.file.FileLocation) SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress) FTPLocation(com.ibm.wsdl.extensions.ftp.FTPLocation)

Aggregations

DefaultLSIDPort (com.ibm.lsid.wsdl.DefaultLSIDPort)1 LSIDAuthorityPort (com.ibm.lsid.wsdl.LSIDAuthorityPort)1 LSIDDataPort (com.ibm.lsid.wsdl.LSIDDataPort)1 LSIDMetadataPort (com.ibm.lsid.wsdl.LSIDMetadataPort)1 LSIDPort (com.ibm.lsid.wsdl.LSIDPort)1 LSIDStandardPort (com.ibm.lsid.wsdl.LSIDStandardPort)1 FileLocation (com.ibm.wsdl.extensions.file.FileLocation)1 FileLocationImpl (com.ibm.wsdl.extensions.file.FileLocationImpl)1 FTPLocation (com.ibm.wsdl.extensions.ftp.FTPLocation)1 FTPLocationImpl (com.ibm.wsdl.extensions.ftp.FTPLocationImpl)1 HTTPAddressImpl (com.ibm.wsdl.extensions.http.HTTPAddressImpl)1 SOAPAddressImpl (com.ibm.wsdl.extensions.soap.SOAPAddressImpl)1 Port (javax.wsdl.Port)1 HTTPAddress (javax.wsdl.extensions.http.HTTPAddress)1 SOAPAddress (javax.wsdl.extensions.soap.SOAPAddress)1