Here you can find the source of hasWebServiceAnnotation(Class> clazz)
private static boolean hasWebServiceAnnotation(Class<?> clazz)
//package com.java2s; //License from project: Apache License import javax.jws.WebService; public class Main { private static boolean hasWebServiceAnnotation(Class<?> clazz) { while (clazz != null) { if (clazz.getDeclaredAnnotation(WebService.class) != null) { return true; }/*www .j a v a2s.co m*/ for (Class<?> anInterface : clazz.getInterfaces()) { if (anInterface.getDeclaredAnnotation(WebService.class) != null) { return true; } } clazz = clazz.getSuperclass(); } return false; } }