// END CXF Initialization
@SuppressWarnings("unchecked")
protected <T> T setupCredentials(final T proxy, final Class<?> serviceInterface, final String username,
final String password) {
if (proxy instanceof SpringServiceProxy) {
SpringServiceProxy service = (SpringServiceProxy) proxy;
if (username == null && password == null) {
service.setRestTemplate(getAnonymousRestTemplate());
} else {
setupRestTemplate(username, password);
}
return proxy;
} else {