Search in sources :

Example 21 with SOAPAddress

use of javax.wsdl.extensions.soap.SOAPAddress in project tomcat by apache.

the class ServiceRefFactory method getSOAPLocation.

/**
 * @param port analyzed port
 * @return Returns the endpoint URL of the given Port
 */
private String getSOAPLocation(Port port) {
    String endpoint = null;
    // Can't change the API
    @SuppressWarnings("unchecked") List<ExtensibilityElement> extensions = port.getExtensibilityElements();
    for (ExtensibilityElement ext : extensions) {
        if (ext instanceof SOAPAddress) {
            SOAPAddress addr = (SOAPAddress) ext;
            endpoint = addr.getLocationURI();
        }
    }
    return endpoint;
}
Also used : SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress) ExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement)

Example 22 with SOAPAddress

use of javax.wsdl.extensions.soap.SOAPAddress in project tomee by apache.

the class WsDeployer method getLocationFromWsdl.

private String getLocationFromWsdl(final Definition definition, final PortComponent portComponent) {
    if (definition == null) {
        return null;
    }
    try {
        final Service service = definition.getService(portComponent.getWsdlService());
        if (service == null) {
            return null;
        }
        final Port port = service.getPort(portComponent.getWsdlPort().getLocalPart());
        if (port == null) {
            return null;
        }
        for (final Object element : port.getExtensibilityElements()) {
            if (element instanceof SOAPAddress) {
                final SOAPAddress soapAddress = (SOAPAddress) element;
                final URI uri = URLs.uri(soapAddress.getLocationURI());
                return uri.getPath();
            } else if (element instanceof HTTPAddress) {
                final HTTPAddress httpAddress = (HTTPAddress) element;
                final URI uri = URLs.uri(httpAddress.getLocationURI());
                return uri.getPath();
            }
        }
    } catch (final Exception e) {
    // no-op
    }
    return null;
}
Also used : HTTPAddress(javax.wsdl.extensions.http.HTTPAddress) Port(javax.wsdl.Port) SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress) Service(javax.wsdl.Service) URI(java.net.URI) MalformedURLException(java.net.MalformedURLException) OpenEJBException(org.apache.openejb.OpenEJBException) IOException(java.io.IOException)

Aggregations

SOAPAddress (javax.wsdl.extensions.soap.SOAPAddress)22 Port (javax.wsdl.Port)12 QName (javax.xml.namespace.QName)9 Service (javax.wsdl.Service)7 SOAP12Address (javax.wsdl.extensions.soap12.SOAP12Address)7 Definition (javax.wsdl.Definition)5 Test (org.junit.Test)5 List (java.util.List)4 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)4 HTTPAddress (javax.wsdl.extensions.http.HTTPAddress)4 URL (java.net.URL)3 Iterator (java.util.Iterator)3 Binding (javax.wsdl.Binding)3 File (java.io.File)2 Map (java.util.Map)2 BindingOperation (javax.wsdl.BindingOperation)2 UnknownExtensibilityElement (javax.wsdl.extensions.UnknownExtensibilityElement)2 SOAPBinding (javax.wsdl.extensions.soap.SOAPBinding)2 SOAPOperation (javax.wsdl.extensions.soap.SOAPOperation)2 ToolException (org.apache.cxf.tools.common.ToolException)2