Package javax.xml.ws

Examples of javax.xml.ws.WebServiceProvider


     *
     * @return non-null port name
     */
    public static @NotNull QName getDefaultPortName(QName serviceName, Class<?> implType) {
        QName portName;
        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
        if (wsProvider!=null) {
            String tns = wsProvider.targetNamespace();
            String local = wsProvider.portName();
            portName = new QName(tns, local);
        } else {
            portName = RuntimeModeler.getPortName(implType, serviceName.getNamespaceURI());
        }
        assert portName != null;
View Full Code Here


        String wsdl;
        WebService ws = implType.getAnnotation(WebService.class);
        if (ws != null) {
            wsdl = ws.wsdlLocation();
        } else {
            WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
            assert wsProvider != null;
            wsdl = wsProvider.wsdlLocation();
        }
        if (wsdl.length() < 1) {
            wsdl = null;
        }
        return wsdl;
View Full Code Here

      if (JavaUtils.isAssignableFrom(Provider.class, sepClass) == false)
         throw new WebServiceException("Endpoint implementation does not implement javax.xml.ws.Provider: " + sepClass.getName());

      // 5.4 Conformance (WebServiceProvider annotation): A Provider based service endpoint implementation
      // MUST carry a WebServiceProvider annotation
      WebServiceProvider anWebServiceProvider = (WebServiceProvider)sepClass.getAnnotation(WebServiceProvider.class);
      if (anWebServiceProvider == null)
         throw new WebServiceException("Cannot obtain @WebServiceProvider annotation from: " + sepClass.getName());

      // 7.3 Conformance (WebServiceProvider and WebService): A class annotated with the WebServiceProvider
      // annotation MUST NOT carry a WebService annotation
      if (sepClass.isAnnotationPresent(WebService.class))
         throw new WebServiceException("Provider cannot carry @WebService annotation: " + sepClass.getName());

      WSDLUtils wsdlUtils = WSDLUtils.getInstance();

      String name = wsdlUtils.getJustClassName(sepClass);

      String serviceName = anWebServiceProvider.serviceName();
      if (serviceName.length() == 0)
         serviceName = name + "Service";

      String targetNS = anWebServiceProvider.targetNamespace();
      if (targetNS.length() == 0)
         targetNS = wsdlUtils.getTypeNamespace(sepClass);

      String portName = anWebServiceProvider.portName();
      if (portName.length() == 0)
         portName = name + "Port";

      ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new QName(targetNS, serviceName));
      wsMetaData.addService(serviceMetaData);

      // Setup the ServerEndpointMetaData
      QName portQName = new QName(targetNS, portName);
      QName portTypeQName = new QName(targetNS, name);
     
      Endpoint ep = dep.getService().getEndpointByName(linkName);
      ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, ep, portQName, portTypeQName, Type.JAXWS);
      sepMetaData.setLinkName(linkName);

      sepMetaData.setStyle(Style.DOCUMENT);
      sepMetaData.setParameterStyle(ParameterStyle.BARE);

      sepMetaData.setServiceEndpointImplName(sepClass.getName());
      sepMetaData.setServiceEndpointInterfaceName(sepClass.getName());

      ServiceMode anServiceMode = sepClass.getAnnotation(ServiceMode.class);
      sepMetaData.setServiceMode(anServiceMode != null ? anServiceMode.value() : Mode.PAYLOAD);

      serviceMetaData.addEndpoint(sepMetaData);

      // Process invoke method
      processInvokeMethod(sepMetaData);

      // Process WSDL
      String wsdlLocation = anWebServiceProvider.wsdlLocation();
      if (wsdlLocation.length() > 0)
      {
         URL wsdlURL = dep.getMetaDataFileURL(wsdlLocation);
         serviceMetaData.setWsdlLocation(wsdlURL);
      }
View Full Code Here

     * @throws java.lang.IllegalArgumentException
     *      If it doesn't have any one of @WebService or @WebServiceProvider
     *      If it has both @WebService and @WebServiceProvider annotations
     */
    public static boolean verifyImplementorClass(Class<?> clz) {
        WebServiceProvider wsProvider = clz.getAnnotation(WebServiceProvider.class);
        WebService ws = clz.getAnnotation(WebService.class);
        if (wsProvider == null && ws == null) {
            throw new IllegalArgumentException(clz +" has neither @WebSerivce nor @WebServiceProvider annotation");
        }
        if (wsProvider != null && ws != null) {
View Full Code Here

     *
     * @return non-null service name
     */
    public static @NotNull QName getDefaultServiceName(Class<?> implType) {
        QName serviceName;
        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
        if (wsProvider!=null) {
            String tns = wsProvider.targetNamespace();
            String local = wsProvider.serviceName();
            serviceName = new QName(tns, local);
        } else {
            serviceName = RuntimeModeler.getServiceName(implType);
        }
        assert serviceName != null;
View Full Code Here

     *
     * @return non-null port name
     */
    public static @NotNull QName getDefaultPortName(QName serviceName, Class<?> implType) {
        QName portName;
        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
        if (wsProvider!=null) {
            String tns = wsProvider.targetNamespace();
            String local = wsProvider.portName();
            portName = new QName(tns, local);
        } else {
            portName = RuntimeModeler.getPortName(implType, serviceName.getNamespaceURI());
        }
        assert portName != null;
View Full Code Here

        String wsdl;
        WebService ws = implType.getAnnotation(WebService.class);
        if (ws != null) {
            wsdl = ws.wsdlLocation();
        } else {
            WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
            assert wsProvider != null;
            wsdl = wsProvider.wsdlLocation();
        }
        if (wsdl.length() < 1) {
            wsdl = null;
        }
        return wsdl;
View Full Code Here

    public static QName getServiceQName(Class<?> clazz) {
        WebService webService = clazz.getAnnotation(WebService.class);
        if (webService != null) {
            return getServiceQName(clazz, webService.targetNamespace(), webService.serviceName());
        }
        WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
        if (webServiceProvider != null) {
            return getServiceQName(clazz, webServiceProvider.targetNamespace(), webServiceProvider.serviceName());
        }
        WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class);
        if (webServiceClient != null) {
            return getServiceQName(clazz, webServiceClient.targetNamespace(), webServiceClient.name());
        }
View Full Code Here

        WebService webService = clazz.getAnnotation(WebService.class);
        if (webService != null) {
            return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
        }

        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");
    }
View Full Code Here

                }
            }
            return getName(clazz, webService.name());
        }

        WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
        if (webServiceProvider != null) {
            return clazz.getName();
        }

        throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
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.