use of javax.jws.WebService in project tomee by apache.
the class JaxWsUtils method getWsdlLocation.
private static String getWsdlLocation(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
String wsdlLocation = webService.wsdlLocation().trim();
if (wsdlLocation.length() == 0) {
wsdlLocation = null;
}
return wsdlLocation;
}
final WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class);
if (webServiceClient != null) {
String wsdlLocation = webServiceClient.wsdlLocation().trim();
if (wsdlLocation.length() == 0) {
wsdlLocation = null;
}
return wsdlLocation;
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
String wsdlLocation = webServiceProvider.wsdlLocation().trim();
if (wsdlLocation.length() == 0) {
wsdlLocation = null;
}
return wsdlLocation;
}
return null;
}
use of javax.jws.WebService in project tomee by apache.
the class JaxWsUtils method getName.
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");
}
use of javax.jws.WebService in project spring-framework by spring-projects.
the class JaxWsPortClientInterceptor method prepare.
/**
* Initialize the JAX-WS port for this interceptor.
*/
public void prepare() {
Class<?> ifc = getServiceInterface();
if (ifc == null) {
throw new IllegalArgumentException("Property 'serviceInterface' is required");
}
WebService ann = ifc.getAnnotation(WebService.class);
if (ann != null) {
applyDefaultsFromAnnotation(ann);
}
Service serviceToUse = getJaxWsService();
if (serviceToUse == null) {
serviceToUse = createJaxWsService();
}
this.portQName = getQName(getPortName() != null ? getPortName() : getServiceInterface().getName());
Object stub = getPortStub(serviceToUse, (getPortName() != null ? this.portQName : null));
preparePortStub(stub);
this.portStub = stub;
}
use of javax.jws.WebService in project wildfly by wildfly.
the class WSIntegrationProcessorJAXWS_POJO method exclude.
private boolean exclude(final DeploymentUnit unit, final EEModuleClassDescription classDescription) {
//exclude if it's ejb3 and jms endpoint
ClassInfo classInfo = null;
ClassAnnotationInformation<WebService, WebServiceAnnotationInfo> annotationInfo = classDescription.getAnnotationInformation(WebService.class);
if (annotationInfo != null) {
classInfo = (ClassInfo) annotationInfo.getClassLevelAnnotations().get(0).getTarget();
} else {
ClassAnnotationInformation<WebServiceProvider, WebServiceProviderAnnotationInfo> providreInfo = classDescription.getAnnotationInformation(WebServiceProvider.class);
classInfo = (ClassInfo) providreInfo.getClassLevelAnnotations().get(0).getTarget();
}
if (isEjb3(classInfo) || isJmsEndpoint(unit, classInfo)) {
return true;
}
return false;
}
use of javax.jws.WebService in project tomee by apache.
the class JaxWsUtils method getServiceQName.
public static QName getServiceQName(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
return getServiceQName(clazz, webService.targetNamespace(), webService.serviceName());
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
return getServiceQName(clazz, webServiceProvider.targetNamespace(), webServiceProvider.serviceName());
}
final WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class);
if (webServiceClient != null) {
return getServiceQName(clazz, webServiceClient.targetNamespace(), webServiceClient.name());
}
throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
Aggregations