Package org.apache.axis2.description

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder


    @Deprecated
    public static AxisService createClientSideAxisService(Definition wsdlDefinition,
                                                          QName wsdlServiceName,
                                                          String portName,
                                                          Options options) throws AxisFault {
        WSDL11ToAxisServiceBuilder serviceBuilder =
                new WSDL11ToAxisServiceBuilder(wsdlDefinition, wsdlServiceName, portName);
        serviceBuilder.setServerSide(false);
        // [rfeng] Add a custom resolver to work around WSCOMMONS-228
        serviceBuilder.setCustomResolver(new URIResolverImpl(wsdlDefinition));
        serviceBuilder.setBaseUri(wsdlDefinition.getDocumentBaseURI());
        // [rfeng]
        AxisService axisService = serviceBuilder.populateService();
        AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoints()
                .get(axisService.getEndpointName());
        options.setTo(new EndpointReference(axisEndpoint.getEndpointURL()));
        if (axisEndpoint != null) {
            options.setSoapVersionURI((String) axisEndpoint.getBinding()
View Full Code Here


                for (Map.Entry<QName, SDODataBindingTypeMappingEntry> e : typeMapping.entrySet()) {
                    typeMapper.addTypeMappingObject(e.getKey(), e.getValue());
                }
                AxisService axisService;
                try {
                    axisService = new WSDL11ToAxisServiceBuilder(definition, serviceQname, port.getName()).populateService();
                } catch (AxisFault e) {
                    throw new CodeGenerationException(e);
                }
                axisService.setName(port.getBinding().getPortType().getQName().getLocalPart());
                CodeGenConfiguration codegenConfiguration = new CodeGenConfiguration(Collections.EMPTY_MAP);
View Full Code Here

        WebServicePortMetaData wsdlPortInfo =
            new WebServicePortMetaData(definition, wsBinding.getWSDLPort(), null, false);

        // TODO investigate if this is 20 wsdl what todo?
        WSDLToAxisServiceBuilder builder =
            new WSDL11ToAxisServiceBuilder(definition, wsdlPortInfo.getServiceName(), wsdlPortInfo.getPort()
                .getName());
        builder.setServerSide(true);
        AxisService axisService = builder.populateService();

        axisService.setName(this.getName());
        axisService.setServiceDescription("Tuscany configured AxisService for service: '" + this.getName()
            + "'");
View Full Code Here

      // that the determination of which builder to use should be done in the builder classes, preferably
      // in the parent builder class.
      // Accessable through a static reference to a method like getBuilderInstance(String wsdlURI) in
      // the parent builder class or through a builder Abstract Factor or Abstract factory methods.
     
      WSDL11ToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(url.openConnection().getInputStream());
         
                        // Set the URI of the base document for the Definition.
                        // Note that this is the URI of the base document, not the imports.
                        builder.setDocumentBaseUri(url.toString());

      builder.setBaseUri(getBaseUri(wsdlURI));
      builder.setCodegen(true);
      return builder.populateService();
    }
View Full Code Here

                definition = wsdlFile.toURL().openStream();
            } catch (Exception e) {
                throw new AxisFault("exception opening wsdl", e);
            }

            WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(definition);
            builder.setServerSide(true);
            axisService = builder.populateService();

            //axisService.setScope(Constants.SCOPE_APPLICATION);
            Parameter userWSDL = new Parameter("useOriginalwsdl", "true");
            axisService.addParameter(userWSDL);
View Full Code Here

           
            // Use getDefinition() so that we have the advantages of the memory features.
            Definition def = getServiceDescriptionImpl().getWSDLWrapper().getDefinition();

            WSDL11ToAxisServiceBuilder serviceBuilder =
                    new WSDL11ToAxisServiceBuilder(def,
                            getServiceDescription().getServiceQName(),
                            getPortQName().getLocalPart());

            if (log.isDebugEnabled()) {
                log.debug("Building AxisService from wsdl: " + getServiceDescriptionImpl().getWSDLWrapper().getWSDLLocation())
                log.debug("Build Axis Service from WSDL ");
                log.debug("  Service QName =" + getServiceDescription().getServiceQName());
                log.debug("  Port QName = "  + getPortQName());
                log.debug("  WSDL = " + def.toString());
            }
                       
            ClassLoader classLoader;
            if (composite.isServiceProvider()) {
                classLoader = composite.getClassLoader();
            } else {
                classLoader = getContextClassLoader(null);
            }
            JAXWSCatalogManager catalogManager = getServiceDescriptionImpl().getCatalogManager();
            CatalogURIResolver uriResolver = new CatalogURIResolver(catalogManager, classLoader);
            serviceBuilder.setCustomResolver(uriResolver);

            if (getServiceDescriptionImpl().isServerSide())
                serviceBuilder.setServerSide(true);
            else
                serviceBuilder.setServerSide(false);

            // Associate the AxisConfiguration with the ServiceBuilder if it
            // is available.  This is done so that the serviceBuilder can
            // use the appropriate WSDL wrapper memory parameters.
            AxisConfiguration ac = null;
            if (composite.getConfigurationContext() != null) {
                ac = composite.getConfigurationContext().getAxisConfiguration();
                if (ac != null) {
                    serviceBuilder.useAxisConfiguration(ac);
                }
            }
            // Create and populate the AxisService
            axisService = serviceBuilder.populateService();
           
            // If an AxisConfiguration was not available,
            // default to using a memory efficient wrapper
            if (ac == null) {
                Parameter wsdlWrapperParam =
View Full Code Here

        try {
            //generate the wsdl
            Definition def = wsdlGenerator.getWSDL(axisService);

            //create the new axis service from the generated wsdl
            WSDL11ToAxisServiceBuilder axisServiceBuilder = new WSDL11ToAxisServiceBuilder(def,
                    getServiceDescription().getServiceQName(), getPortQName().getLocalPart());

            if (getServiceDescriptionImpl().isServerSide()) {
                axisServiceBuilder.setServerSide(true);
            } else {
                axisServiceBuilder.setServerSide(false);
            }

            this.axisService = axisServiceBuilder.populateService();
            axisService.setName(getServiceDescription().getServiceQName().getLocalPart());
            axisService.setParent(axisConfig);

            // we always get only one endpoint as there's only one port in the generated WSDL
            // from wsgen. Set the transport for that endpoint as http by default.
View Full Code Here

        } else {
            url = new URL(wsdlURI);
        }


        WSDL11ToAxisServiceBuilder builder =
                new WSDL11ToAxisServiceBuilder(url.openConnection().getInputStream());

        builder.setDocumentBaseUri(url.toString());
        builder.setBaseUri(getBaseUri(wsdlURI));
        builder.setCodegen(true);
        return builder.populateService();
    }
View Full Code Here

            // TODO: Change this to use WSDLToAxisServiceBuilder superclass
            // Note that the axis service builder takes only the localpart of the port qname.
            // TODO:: This should check that the namespace of the definition matches the namespace of the portQName per JAXRPC spec

            WSDLWrapper wrapper = getServiceDescriptionImpl().getWSDLWrapper();
            WSDL11ToAxisServiceBuilder serviceBuilder =
                    new WSDL11ToAxisServiceBuilder(
                            wrapper.getDefinition(),
                            getServiceDescription().getServiceQName(),
                            getPortQName().getLocalPart());

            //TODO: Temporary, please change the following log.info to log.debug
            log.info("Building AxisService from wsdl: " + wrapper.getWSDLLocation());
           
            if (getServiceDescriptionImpl().isDBCMap()) {
                //this.class.getClass().getClassLoader();
                URIResolverImpl uriResolver =
                        new URIResolverImpl(composite.getClassLoader());
                serviceBuilder.setCustomResolver(uriResolver);
            } else {
                ClassLoader classLoader = (ClassLoader)AccessController.doPrivileged(new
                        PrivilegedAction() {
                            public Object run() {
                                return Thread.currentThread().getContextClassLoader();
                            }
                        });
                URIResolverImpl uriResolver = new URIResolverImpl(classLoader);
                serviceBuilder.setCustomResolver(uriResolver);
            }

            // TODO: Currently this only builds the client-side AxisService;
            // it needs to do client and server somehow.
            // Patterned after AxisService.createClientSideAxisService
            if (getServiceDescriptionImpl().isServerSide())
                serviceBuilder.setServerSide(true);
            else
                serviceBuilder.setServerSide(false);

            axisService = serviceBuilder.populateService();
            axisService.setName(createAxisServiceName());
            isBuiltFromWSDL = true;

        } catch (AxisFault e) {
            // REVIEW: If we couldn't use the WSDL, should we fail instead of continuing to process using annotations?
View Full Code Here

                    wsdlStream = serviceClassLoader
                            .getResourceAsStream(wsdlLocation);
                    wsdlURL = serviceClassLoader.getResource(wsdlLocation);
                }
                if (wsdlStream != null) {
                    WSDL11ToAxisServiceBuilder wsdl2AxisServiceBuilder =
                            new WSDL11ToAxisServiceBuilder(wsdlStream, null, null);
                    File file = Utils.toFile(servicesURL);
                    if(file != null && file.exists()){
                        wsdl2AxisServiceBuilder.setCustomWSLD4JResolver(
                                    new AARBasedWSDLLocator(wsdlLocation, file, wsdlStream));
                        wsdl2AxisServiceBuilder.setCustomResolver(
                                new AARFileBasedURIResolver(file));
                    }
                    if (wsdlURL != null) {
                        wsdl2AxisServiceBuilder.setDocumentBaseUri(wsdlURL.toString());
                    }
                    axisService = wsdl2AxisServiceBuilder.populateService();
                    axisService.setWsdlFound(true);
                    axisService.setCustomWsdl(true);
                    axisService.setName(serviceName);
                }
                if (axisService == null) {
                    axisService = new AxisService(serviceName);
                }

                axisService.setParent(serviceGroup);
                axisService.setClassLoader(serviceClassLoader);

                ServiceBuilder serviceBuilder = new ServiceBuilder(configContext, axisService);
                AxisService service = serviceBuilder.populateService(rootElement);

                ArrayList serviceList = new ArrayList();
                serviceList.add(service);
                return serviceList;
            } else if (TAG_SERVICE_GROUP.equals(elementName)) {
                ServiceGroupBuilder groupBuilder = new ServiceGroupBuilder(rootElement, servicesMap,
                                                                           configContext);
                ArrayList servicList = groupBuilder.populateServiceGroup(serviceGroup);
                Iterator serviceIterator = servicList.iterator();
                while (serviceIterator.hasNext()) {
                    AxisService axisService = (AxisService) serviceIterator.next();
                    String wsdlLocation =  "META-INF/service.wsdl";
                    InputStream wsdlStream =
                            serviceClassLoader.getResourceAsStream(wsdlLocation);
                    URL wsdlURL = serviceClassLoader.getResource(wsdlLocation);
                    if (wsdlStream == null) {
                        wsdlLocation =  "META-INF/" + serviceName + ".wsdl";
                        wsdlStream = serviceClassLoader
                                .getResourceAsStream(wsdlLocation);
                        wsdlURL =
                                serviceClassLoader.getResource(wsdlLocation);
                    }
                    if (wsdlStream != null) {
                        WSDL11ToAxisServiceBuilder wsdl2AxisServiceBuilder =
                                new WSDL11ToAxisServiceBuilder(wsdlStream, axisService);
                        File file = Utils.toFile(servicesURL);
                        if(file != null && file.exists()){
                            wsdl2AxisServiceBuilder.setCustomWSLD4JResolver(
                                        new AARBasedWSDLLocator(wsdlLocation, file, wsdlStream));
                            wsdl2AxisServiceBuilder.setCustomResolver(
                                    new AARFileBasedURIResolver(file));
                        }
                        if (wsdlURL != null) {
                            wsdl2AxisServiceBuilder.setDocumentBaseUri(wsdlURL.toString());
                        }
                        axisService = wsdl2AxisServiceBuilder.populateService();
                        axisService.setWsdlFound(true);
                        axisService.setCustomWsdl(true);
                        // Set the default message receiver for the operations that were
                        // not listed in the services.xml
                        Iterator operations = axisService.getOperations();
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

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.