Java Code Examples for javax.jws.WebService#endpointInterface()

The following examples show how to use javax.jws.WebService#endpointInterface() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JaxWsUtils.java    From tomee with Apache License 2.0 6 votes vote down vote up
public static String getName(final Class<?> clazz) {
    final WebService webService = clazz.getAnnotation(WebService.class);
    if (webService != null) {
        final String sei = webService.endpointInterface();
        if (sei != null && sei.trim().length() != 0) {
            try {
                final Class seiClass = clazz.getClassLoader().loadClass(sei.trim());
                return getNameFromInterface(seiClass);
            } catch (final ClassNotFoundException e) {
                throw new OpenEJBRuntimeException("Unable to load SEI class: " + sei, e);
            }
        }
        return getName(clazz, webService.name());
    }

    final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
    if (webServiceProvider != null) {
        return clazz.getName();
    }

    throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
 
Example 2
Source File: JaxWsImplementorInfo.java    From cxf with Apache License 2.0 5 votes vote down vote up
private String getImplementorClassName() {
    for (WebService service : wsAnnotations) {
        if (!StringUtils.isEmpty(service.endpointInterface())) {
            return service.endpointInterface();
        }
    }
    return null;
}
 
Example 3
Source File: JaxWsUtils.java    From tomee with Apache License 2.0 5 votes vote down vote up
public static String getServiceInterface(final Class<?> clazz) {
    WebService webService = clazz.getAnnotation(WebService.class);
    String endpointInterface = null;
    if (webService != null && webService.endpointInterface() != null) {
        endpointInterface = webService.endpointInterface().trim();
        if (endpointInterface.length() == 0) {
            endpointInterface = null;

        } else {
            return endpointInterface;
        }
    }

    // if the bean implements only one WebService class, that is the SEI
    for (final Class<?> intf : clazz.getInterfaces()) {
        // interface MUST also have a @WebService
        webService = intf.getAnnotation(WebService.class);
        if (webService != null) {
            if (endpointInterface == null) {
                endpointInterface = intf.getName();
            } else {
                // multiple endpoint interfaces
                endpointInterface = null;
                break;
            }
        }
    }

    return endpointInterface;
}