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