}
// Derive the address of the owner endpoint.
// e.g. http://localhost/foo/mex --> http://localhost/foo
WSEndpoint ownerEndpoint = null;
ServletModule module = (ServletModule) wsEndpoint.getContainer().getSPI(ServletModule.class);
String baseAddress = module.getContextPath(servletRequest);
String ownerEndpointAddress = null;
List<BoundEndpoint> boundEndpoints = module.getBoundEndpoints();
for (BoundEndpoint endpoint : boundEndpoints) {
if (endpoint.getEndpoint().equalsProxiedInstance(wsEndpoint)) {
ownerEndpointAddress = endpoint.getAddress(baseAddress).toString();
break;
}
}
if (ownerEndpointAddress != null) {
ownerEndpointAddress = getAddressFromMexAddress(ownerEndpointAddress, wsEndpoint.getBinding().getSOAPVersion());
boundEndpoints = module.getBoundEndpoints();
for (BoundEndpoint endpoint : boundEndpoints) {
//compare ownerEndpointAddress with this endpoints address
// if matches, set ownerEndpoint to the corresponding WSEndpoint
String endpointAddress = endpoint.getAddress(baseAddress).toString();
if (endpointAddress.equals(ownerEndpointAddress)) {