enhancer.setUseCache(false);
Class serviceClass = enhancer.createClass();
Enhancer.registerCallbacks(serviceClass, methodInterceptors);
FastConstructor constructor =
FastClass.create(serviceClass).getConstructor(URL_SERVICE_NAME_CONSTRUCTOR);
Object[] arguments =
new Object[]{wsdlLocation, serviceName};
LOG.debug("Initializing service with: " + wsdlLocation + " " + serviceName);
try {
return (Service)constructor.newInstance(arguments);
} catch (InvocationTargetException e) {
NamingException exception = new NamingException("Could not construct service proxy");
exception.initCause(e.getTargetException());
throw exception;
}