use of javax.jws.WebService in project tomee by apache.
the class JaxWsUtils method getPortQName.
public static QName getPortQName(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
return getPortQName(clazz, webServiceProvider.targetNamespace(), null, webServiceProvider.portName());
}
throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
use of javax.jws.WebService in project tomee by apache.
the class JaxWsUtils method getPortType.
public static QName getPortType(final Class<?> seiClass) {
final WebService webService = seiClass.getAnnotation(WebService.class);
if (webService != null) {
String localName = webService.name();
if (localName == null || localName.length() == 0) {
localName = seiClass.getSimpleName();
}
final String namespace = webService.targetNamespace();
return new QName(getNamespace(seiClass, namespace), localName);
}
return null;
}
use of javax.jws.WebService in project tomee by apache.
the class JaxWsUtils method getServiceInterface.
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;
}
Aggregations