Examples of WSDL11ToAxisServiceBuilder


Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

        }

        try {
            URI baseUri = pconf.getBaseURI().resolve(wsdlDefinition.getDocumentBaseURI());
            InputStream is = baseUri.toURL().openStream();
            WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisPatchedBuilder(is, wsdlServiceName, portName);
            serviceBuilder.setBaseUri(baseUri.toString());
            serviceBuilder.setCustomResolver(new Axis2UriResolver());
            serviceBuilder.setCustomWSLD4JResolver(new Axis2WSDLLocator(baseUri));
            serviceBuilder.setServerSide(true);

            AxisService axisService = serviceBuilder.populateService();
            axisService.setName(serviceName);
            axisService.setWsdlFound(true);
            axisService.setCustomWsdl(true);
            axisService.setClassLoader(axisConfig.getServiceClassLoader());
       
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

    }

    public static AxisService createService(AxisConfiguration axisConfig, QName serviceQName, String port,
                                            String axisName, Definition wsdlDef, MessageReceiver receiver) throws AxisFault {

        WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisServiceBuilder(wsdlDef, serviceQName, port);
        AxisService axisService = serviceBuilder.populateService();
        axisService.setName(axisName);
        axisService.setWsdlFound(true);
        axisService.setClassLoader(axisConfig.getServiceClassLoader());
        Iterator operations = axisService.getOperations();
        while (operations.hasNext()) {
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

    public static AxisService createClientSideAxisService(Definition definition,
                                                          QName serviceName,
                                                          String portName,
                                                          Options options) throws AxisFault {
        Definition def = getDefinition(definition, serviceName);
        final WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisServiceBuilder(def, serviceName, portName);
        serviceBuilder.setServerSide(false);
        // [rfeng] Add a custom resolver to work around WSCOMMONS-228
        serviceBuilder.setCustomResolver(new URIResolverImpl(def));
        serviceBuilder.setBaseUri(def.getDocumentBaseURI());
        // [rfeng]
        // Allow access to read properties. Requires PropertiesPermission in security policy.
        AxisService axisService;        
        try {       
            axisService = AccessController.doPrivileged(new PrivilegedExceptionAction<AxisService>() {
                public AxisService run() throws AxisFault {
                    return serviceBuilder.populateService();
                }
            });
            } catch ( PrivilegedActionException e ) {
               throw (AxisFault) e.getException();
            }
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

        Definition definition = wsBinding.getWSDLDocument();
        QName serviceQName = wsBinding.getService().getQName();
        Definition def = getDefinition(definition, serviceQName);

        final WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(def, serviceQName, port.getName());
        builder.setServerSide(true);
        // [rfeng] Add a custom resolver to work around WSCOMMONS-228
        builder.setCustomResolver(new URIResolverImpl(def));
        builder.setBaseUri(def.getDocumentBaseURI());
        // [rfeng]       
        // AxisService axisService = builder.populateService();
        // Allow privileged access to read properties. Requires PropertiesPermission read in
        // security policy.
        AxisService axisService;
        try {
            axisService = AccessController.doPrivileged(new PrivilegedExceptionAction<AxisService>() {
                public AxisService run() throws AxisFault {
                    return builder.populateService();
                }
            });
        } catch (PrivilegedActionException e) {
            throw (AxisFault)e.getException();
        }
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

            log.debug("Creating AxisService: Service=" + serviceName + " port=" + portName +
                      " WSDL=" + wsdlDefinition.getDocumentBaseURI() + " BPEL=" +
                      processConfiguration.getBpelDocument());
        }

        WSDL11ToAxisServiceBuilder serviceBuilder = createAxisServiceBuilder(processProxy);

        /** Need to figure out a way to handle service name extractoin. According to my perspective extracting
         * the service name from the EPR is not a good decision. But we need to handle JMS case properly.
         * I am keeping JMS handling untouched until we figureout best solution. */
        /* String axisServiceName = extractServiceName(processConf, wsdlServiceName, portName);*/
 
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

            handleException(pid, errMsg, e);
        } catch (IOException e) {
            String errMsg = "Error opening stream.";
            handleException(pid, errMsg, e);
        }
        WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisPatchedBuilder(wsdlInStream,
                                                                                   serviceName,
                                                                                   portName);
        serviceBuilder.setBaseUri(wsdlBaseURI.toString());
        serviceBuilder.setCustomResolver(new Axis2UriResolver());
        try {
            serviceBuilder.setCustomWSDLResolver(new Axis2WSDLLocator(wsdlBaseURI));
        } catch (URISyntaxException e) {
            String errorMessage = "URI syntax invalid.";
            handleException(pid, errorMessage, e);
        }
        serviceBuilder.setServerSide(true);

        return serviceBuilder;
    }
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

        AxisService axisService = null;
       
        try{
            CodeGenerationEngine codeGenerationEngine  = new CodeGenerationEngine(codeGenConfiguration);
            Definition wsdl4jDef = codeGenerationEngine.readInTheWSDLFile(serviceUri + "?wsdl");
            WSDL11ToAxisServiceBuilder wsdl11ToAxisServiceBuilder = new WSDL11ToAxisServiceBuilder
                    (wsdl4jDef, null, null, false);
            axisService = wsdl11ToAxisServiceBuilder.populateService();
        } catch (WSDLException e) {
            log.warn("Operation List can not be created for given wsdl uri  " + serviceUri + "?wsdl");
        } catch (CodeGenerationException e) {
            log.warn("Operation List can not be created for given wsdl uri  " + serviceUri + "?wsdl");
        }
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

        protected void deployService(String bundleName, String defFile, QName serviceName, String port,
                                     MessageReceiver receiver) throws WSDLException, IOException, URISyntaxException {
            URI wsdlUri = new File(getResource(bundleName) + "/" + defFile).toURI();

            InputStream is = wsdlUri.toURL().openStream();
            WSDL11ToAxisServiceBuilder serviceBuilder = new ODEAxisService.WSDL11ToAxisPatchedBuilder(is, serviceName, port);
            serviceBuilder.setBaseUri(wsdlUri.toString());
            serviceBuilder.setCustomResolver(new Axis2UriResolver());
            serviceBuilder.setCustomWSLD4JResolver(new Axis2WSDLLocator(wsdlUri));
            serviceBuilder.setServerSide(true);

            AxisService axisService = serviceBuilder.populateService();
            axisService.setName(serviceName.getLocalPart());
            axisService.setWsdlFound(true);
            axisService.setCustomWsdl(true);
            axisService.setClassLoader(getConfigurationContext().getAxisConfiguration().getServiceClassLoader());
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

        try {
            OMElement documentElement = (OMElement) XMLUtils.toOM(inputStream);
            OMNamespace documentElementNS = documentElement.getNamespace();
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            if (documentElementNS != null) {
                WSDL11ToAxisServiceBuilder wsdl11ToAxisServiceBuilder;
                if (Constants.NS_URI_WSDL11.
                        equals(documentElementNS.getNamespaceURI())) {
                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                    documentElement.serialize(outputStream);
                    InputStream inStream = new ByteArrayInputStream(outputStream.toByteArray());
                    wsdl11ToAxisServiceBuilder = new WSDL11ToAllAxisServicesBuilder(inStream);
                    (wsdl11ToAxisServiceBuilder).setBaseUri(uri);
                    wsdl11ToAxisServiceBuilder.setAllPorts(true);
                    AxisService service = wsdl11ToAxisServiceBuilder.populateService();
                    Map endpointsMap = service.getEndpoints();
                    Iterator iterator = endpointsMap.values().iterator();
                    String[] eprs = new String[endpointsMap.size()];
                    int i=0;
                    while (iterator.hasNext()) {
View Full Code Here

Examples of org.apache.axis2.description.WSDL11ToAxisServiceBuilder

                    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.setCustomWSDLResolver(
                                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.setCustomWSDLResolver(
                                    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
Copyright © 2018 www.massapi.com. 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.