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;
}
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;
}
Aggregations