Search in sources :

Example 6 with WebService

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;
}
Also used : WebServiceProvider(javax.xml.ws.WebServiceProvider) WebService(javax.jws.WebService) WebServiceClient(javax.xml.ws.WebServiceClient)

Example 7 with WebService

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");
}
Also used : OpenEJBRuntimeException(org.apache.openejb.OpenEJBRuntimeException) WebServiceProvider(javax.xml.ws.WebServiceProvider) WebService(javax.jws.WebService)

Example 8 with WebService

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;
}
Also used : WebService(javax.jws.WebService) Service(javax.xml.ws.Service) WebService(javax.jws.WebService)

Example 9 with WebService

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;
}
Also used : WebServiceProvider(javax.xml.ws.WebServiceProvider) WebService(javax.jws.WebService) ClassInfo(org.jboss.jandex.ClassInfo)

Example 10 with WebService

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");
}
Also used : WebServiceProvider(javax.xml.ws.WebServiceProvider) WebService(javax.jws.WebService) WebServiceClient(javax.xml.ws.WebServiceClient)

Aggregations

WebService (javax.jws.WebService)13 WebServiceProvider (javax.xml.ws.WebServiceProvider)9 ClassInfo (org.jboss.jandex.ClassInfo)4 WebServiceClient (javax.xml.ws.WebServiceClient)2 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)2 EEModuleClassDescription (org.jboss.as.ee.component.EEModuleClassDescription)2 CompositeIndex (org.jboss.as.server.deployment.annotation.CompositeIndex)2 EJBEndpoint (org.jboss.as.webservices.metadata.model.EJBEndpoint)2 POJOEndpoint (org.jboss.as.webservices.metadata.model.POJOEndpoint)2 JBossWebMetaData (org.jboss.metadata.web.jboss.JBossWebMetaData)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 QName (javax.xml.namespace.QName)1 Endpoint (javax.xml.ws.Endpoint)1 Service (javax.xml.ws.Service)1 OpenEJBRuntimeException (org.apache.openejb.OpenEJBRuntimeException)1 EEModuleDescription (org.jboss.as.ee.component.EEModuleDescription)1 WebServiceAnnotationInfo (org.jboss.as.webservices.deployers.WebServiceAnnotationInfo)1 WebServiceProviderAnnotationInfo (org.jboss.as.webservices.deployers.WebServiceProviderAnnotationInfo)1