Package javax.xml.ws

Examples of javax.xml.ws.WebServiceProvider


       
        EndpointReferenceType ref =
            EndpointReferenceUtils.getEndpointReference(manager, provider1);
        assertNotNull(ref);
       
        WebServiceProvider wsp = provider1.getClass().getAnnotation(WebServiceProvider.class);
        assertNotNull(wsp);
        assertEquals(wsp.portName(), EndpointReferenceUtils.getPortName(ref));
        assertNotNull(EndpointReferenceUtils.getServiceName(ref));
       
        QName portTypeName = new QName(wsp.targetNamespace(),
                                       TestProvider1.class.getSimpleName());
        assertEquals(portTypeName, EndpointReferenceUtils.getInterfaceName(ref));
       
        //Test with default values for WebServiceProvider Annotation
        TestProvider2 provider2 = new TestProvider2();
View Full Code Here


    public static EndpointReferenceType getEndpointReference(WSDLManager manager,
                                                                 Class<?> implementorClass) {

        WebService ws = getWebServiceAnnotation(implementorClass);

        WebServiceProvider wsp = null;
        if (null == ws) {
            wsp = implementorClass.getAnnotation(WebServiceProvider.class);
            if (null == wsp) {
                return null;
            }
        }

        EndpointReferenceType reference = new EndpointReferenceType();
        reference.setMetadata(new MetadataType());
        String serviceName = (null != ws) ? ws.serviceName() : wsp.serviceName();
        String targetNamespace = (null != ws) ? ws.targetNamespace() : wsp.targetNamespace();
        String portName = (null != ws) ? ws.portName() : wsp.portName();
        String url = (null != ws) ? ws.wsdlLocation() : wsp.wsdlLocation();
        String className = (null != ws) ? ws.endpointInterface() : null;
    
        QName portTypeName = null;
        if (null != className && !"".equals(className)) {
            Class<?> seiClazz = null;
View Full Code Here

    PortInfo portInfo = null;

    BindingType bindingType
      = (BindingType) _class.getAnnotation(BindingType.class);

    WebServiceProvider provider =
      (WebServiceProvider) _class.getAnnotation(WebServiceProvider.class);

    if (provider != null && bindingType != null) {
      QName portName = new QName(provider.targetNamespace(),
                                 provider.portName());
      QName serviceName = new QName(provider.targetNamespace(),
                                    provider.serviceName());

      portInfo = new PortInfoImpl(bindingType.value(), portName, serviceName);
    }

    HandlerChain handlerChain =
View Full Code Here

   
    public static QName getServiceQName(Class clazz) {
        WebService webService =
            (WebService)clazz.getAnnotation(WebService.class);
        if (webService == null) {
            WebServiceProvider webServiceProvider =
                (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
            if (webServiceProvider == null) {
                throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
            }
            return getServiceQName(clazz, webServiceProvider.targetNamespace(), webServiceProvider.serviceName());
        } else {
            return getServiceQName(clazz, webService.targetNamespace(), webService.serviceName());
        }
    }
View Full Code Here

   
    public static QName getPortQName(Class clazz) {
        WebService webService =
            (WebService)clazz.getAnnotation(WebService.class);
        if (webService == null) {
            WebServiceProvider webServiceProvider =
                (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
            if (webServiceProvider == null) {
                throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
            }
            return getPortQName(clazz, webServiceProvider.targetNamespace(), null, webServiceProvider.portName());
        } else {
            return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
        }
    }
View Full Code Here

       
    public static String getName(Class clazz) {
        WebService webService =
            (WebService)clazz.getAnnotation(WebService.class);
        if (webService == null) {
            WebServiceProvider webServiceProvider =
                (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
            if (webServiceProvider == null) {
                throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
            }
            return clazz.getSimpleName();        
View Full Code Here

    }

    private static String getWsdlLocation(Class clazz) {
        WebService webService = (WebService) clazz.getAnnotation(WebService.class);
        if (webService == null) {
            WebServiceProvider webServiceProvider =
                (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
            if (webServiceProvider == null) { //no WebService or WebServiceProvider annotation
                return "";
            } else {
                return webServiceProvider.wsdlLocation().trim();
            }
        } else {
            return webService.wsdlLocation().trim();
        }
    }
View Full Code Here

     * <code>DescriptionBuilderComposite</code>
     *
     * @param composite - <code>DescriptionBuildercomposite</code>
     */
    private void attachWebServiceProviderAnnotation(DescriptionBuilderComposite composite) {
        WebServiceProvider webServiceProvider = (WebServiceProvider)ConverterUtils.
                getAnnotation(WebServiceProvider.class, serviceClass);
        if (webServiceProvider != null) {
            // Attach @WebServiceProvider annotation data
            WebServiceProviderAnnot wspAnnot = WebServiceProviderAnnot.
                    createWebServiceAnnotImpl();
            wspAnnot.setPortName(webServiceProvider.portName());
            wspAnnot.setServiceName(webServiceProvider.serviceName());
            wspAnnot.setTargetNamespace(webServiceProvider.targetNamespace());
            wspAnnot.setWsdlLocation(webServiceProvider.wsdlLocation());
            composite.setWebServiceProviderAnnot(wspAnnot);
        }
    }
View Full Code Here

   
    public static String getServiceName(Class clazz) {
        WebService webService =
            (WebService)clazz.getAnnotation(WebService.class);
        if (webService == null) {
            WebServiceProvider webServiceProvider =
                (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
            if (webServiceProvider == null) {
                throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
            }
            return getServiceName(clazz, webServiceProvider.serviceName());
        } else {
            return getServiceName(clazz, webService.serviceName());
        }
    }
View Full Code Here

   
    public static String getName(Class clazz) {
        WebService webService =
            (WebService)clazz.getAnnotation(WebService.class);
        if (webService == null) {
            WebServiceProvider webServiceProvider =
                (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
            if (webServiceProvider == null) {
                throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
            }
            return clazz.getSimpleName();        
View Full Code Here

TOP

Related Classes of javax.xml.ws.WebServiceProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.