Search in sources :

Example 11 with WebService

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

Example 12 with WebService

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

Example 13 with WebService

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

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