Search in sources :

Example 1 with HTTPAddress

use of javax.wsdl.extensions.http.HTTPAddress 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

IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 Port (javax.wsdl.Port)1 Service (javax.wsdl.Service)1 HTTPAddress (javax.wsdl.extensions.http.HTTPAddress)1 SOAPAddress (javax.wsdl.extensions.soap.SOAPAddress)1 OpenEJBException (org.apache.openejb.OpenEJBException)1