Search in sources :

Example 1 with WebServiceClient

use of javax.xml.ws.WebServiceClient 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 2 with WebServiceClient

use of javax.xml.ws.WebServiceClient 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)2 WebServiceClient (javax.xml.ws.WebServiceClient)2 WebServiceProvider (javax.xml.ws.WebServiceProvider)2