protected void retrieveProxiedEndpointDefinition() {
if (logger.isDebugEnabled()) {
logger.debug("Retrieving proxied endpoint definition");
}
try {
ComponentContext ctx = this.serviceUnit.getComponent().getComponentContext();
ServiceEndpoint ep = null;
if (targetService != null && targetEndpoint != null) {
ep = ctx.getEndpoint(targetService, targetEndpoint);
if (ep == null && logger.isDebugEnabled()) {
logger.debug("Could not retrieve endpoint targetService/targetEndpoint");
}
}
if (ep == null && targetService != null) {
ServiceEndpoint[] eps = ctx.getEndpointsForService(targetService);
if (eps != null && eps.length > 0) {
ep = eps[0];
}
if (ep == null && logger.isDebugEnabled()) {
logger.debug("Could not retrieve endpoint for targetService");
}
}
if (ep == null && targetInterfaceName != null) {
ServiceEndpoint[] eps = ctx.getEndpoints(targetInterfaceName);
if (eps != null && eps.length > 0) {
ep = eps[0];
}
if (ep == null && logger.isDebugEnabled()) {
logger.debug("Could not retrieve endpoint for targetInterfaceName");
}
}
if (ep == null && service != null && endpoint != null) {
ep = ctx.getEndpoint(service, endpoint);
if (ep == null && logger.isDebugEnabled()) {
logger.debug("Could not retrieve endpoint for service/endpoint");
}
}
if (ep != null) {
Document doc = ctx.getEndpointDescriptor(ep);
if (doc != null) {
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
reader.setFeature(Constants.FEATURE_VERBOSE, false);
Definition def = reader.readWSDL(null, doc);
if (def != null) {