Package org.apache.axis2.description

Examples of org.apache.axis2.description.WSDL20ToAxisServiceBuilder


        String portName = port.getName();
           QName serviceQName = wsdlService.getQName();

           //Decide WSDL Version :
        if(WSDLConstants.WSDL20_2006Constants.DEFAULT_NAMESPACE_URI.equals(documentElementNS.getNamespaceURI())){
            wsdlBuilder = new WSDL20ToAxisServiceBuilder(new ByteArrayInputStream(wsdlContent.getBytes()), serviceQName, null);
        }
        else if(Constants.NS_URI_WSDL11.equals(documentElementNS.getNamespaceURI())){
            wsdlBuilder = new WSDL11ToAxisServiceBuilder(wsdlDefinition, serviceQName , portName);
        }
        //populate with axis2 objects
View Full Code Here


            configuration = new CodeGenConfiguration(allOptions);


            if (CommandLineOptionConstants.WSDL2JavaConstants.WSDL_VERSION_2.
                    equals(configuration.getWSDLVersion())) {
                WSDL20ToAxisServiceBuilder builder = new WSDL20ToAxisServiceBuilder(wsdlUri,
                                                                                    configuration.getServiceName(),
                                                                                    configuration.getPortName());
                builder.setCodegen(true);
                configuration.addAxisService(builder.populateService());

            } else {
                //It'll be WSDL 1.1
                Definition wsdl4jDef = readInTheWSDLFile(wsdlUri);

                // we save the original wsdl definition to write it to the resource folder later
                // this is required only if it has imports
                Map imports = wsdl4jDef.getImports();
                if ((imports != null) && (imports.size() > 0)) {
                    configuration.setWsdlDefinition(readInTheWSDLFile(wsdlUri));
                } else {
                    configuration.setWsdlDefinition(wsdl4jDef);
                }

                // we generate the code for one service and one port if the
                // user has specified them.
                // otherwise generate the code for every service.
                // TODO: find out a permanant solution for this.
                QName serviceQname = null;

                if (configuration.getServiceName() != null) {
                    serviceQname = new QName(wsdl4jDef.getTargetNamespace(),
                                             configuration.getServiceName());
                }

                WSDL11ToAxisServiceBuilder builder = null;
                // jibx currently does not support multiservice
                if ((serviceQname != null) || (configuration.getDatabindingType().equals("jibx"))) {
                    builder = new WSDL11ToAxisServiceBuilder(
                            wsdl4jDef,
                            serviceQname,
                            configuration.getPortName());
                    builder.setCodegen(true);
                    configuration.addAxisService(builder.populateService());
                } else {
                    builder = new WSDL11ToAllAxisServicesBuilder(wsdl4jDef);
                    builder.setCodegen(true);
                    configuration.setAxisServices(
                            ((WSDL11ToAllAxisServicesBuilder)builder).populateAllServices());
                }
            }
View Full Code Here

                        if (documentElementNS != null) {
                            WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder = null;
                            if (WSDL2Constants.WSDL_NAMESPACE
                                    .equals(documentElementNS.getNamespaceURI())) {
                                // we have a WSDL 2.0 document here.
                                wsdlToAxisServiceBuilder = new WSDL20ToAxisServiceBuilder(
                                        new ByteArrayInputStream(out.toByteArray()), null, null);
                                wsdlToAxisServiceBuilder.setBaseUri(entryName);
                            } else if (Constants.NS_URI_WSDL11.
                                    equals(documentElementNS.getNamespaceURI())) {
                                wsdlToAxisServiceBuilder = new WSDL11ToAxisServiceBuilder(
View Full Code Here

                    WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder = null;
                    if (WSDL2Constants.WSDL_NAMESPACE
                            .equals(documentElementNS.getNamespaceURI())) {
                        // we have a WSDL 2.0 document here.
                        in2 = new FileInputStream(file1);
                        wsdlToAxisServiceBuilder = new WSDL20ToAxisServiceBuilder(in2, null, null);
                    } else if (Constants.NS_URI_WSDL11.
                            equals(documentElementNS.getNamespaceURI())) {
                        in2 = new FileInputStream(file1);
                        wsdlToAxisServiceBuilder = new WSDL11ToAxisServiceBuilder(in2, null, null);
                    } else {
View Full Code Here

        //  server and it is needed to call it from synapse using the main sequence
        //  2) request is to be injected into  the main sequence  .i.e. http://localhost:8280
        // This method does not cause any performance issue ...
        // Proper fix should be refractoring axis2 RestUtil in a proper way
        if (dispatching) {
            RequestURIBasedDispatcher requestDispatcher = new RequestURIBasedDispatcher();
            AxisService axisService = requestDispatcher.findService(msgContext);
            if (axisService == null) {
                String defaultSvcName = NHttpConfiguration.getInstance().getStringValue(
                        "nhttp.default.service", "__SynapseService");
                axisService = msgContext.getConfigurationContext()
                        .getAxisConfiguration().getService(defaultSvcName);
View Full Code Here

                String serverName = (String)
                        messageContext.getProperty(SynapseConstants.Axis2Param.SYNAPSE_SERVER_NAME);

                if(serverName != null && messageContext instanceof Axis2MessageContext) {

                    AxisConfiguration configuration = ((Axis2MessageContext)messageContext).
                            getAxis2MessageContext().
                            getConfigurationContext().getAxisConfiguration();

                    String myServerName = getAxis2ParameterValue(configuration,
                            SynapseConstants.Axis2Param.SYNAPSE_SERVER_NAME);
View Full Code Here

    /**
     * Start the proxy service
     * @param synCfg the synapse configuration
     */
    public void start(SynapseConfiguration synCfg) {
        AxisConfiguration axisConfig = synCfg.getAxisConfiguration();
        if (axisConfig != null) {

            Parameter param = axisConfig.getParameter(SynapseConstants.SYNAPSE_ENV);
            if (param != null && param.getValue() instanceof SynapseEnvironment)  {
                SynapseEnvironment env = (SynapseEnvironment) param.getValue();
                if (targetInLineInSequence != null) {
                    targetInLineInSequence.init(env);
                }
                if (targetInLineOutSequence != null) {
                    targetInLineOutSequence.init(env);
                }
                if (targetInLineFaultSequence != null) {
                    targetInLineFaultSequence.init(env);
                }
            } else {
                auditWarn("Unable to find the SynapseEnvironment. " +
                    "Components of the proxy service may not be initialized");
            }

            AxisService as = axisConfig.getServiceForActivation(this.getName());
            as.setActive(true);
            axisConfig.notifyObservers(new AxisEvent(AxisEvent.SERVICE_START, as), as);
            this.setRunning(true);
            auditInfo("Started the proxy service : " + name);
        } else {
            auditWarn("Unable to start proxy service : " + name +
                ". Couldn't access Axis configuration");
View Full Code Here

    /**
     * Stop the proxy service
     * @param synCfg the synapse configuration
     */
    public void stop(SynapseConfiguration synCfg) {
        AxisConfiguration axisConfig = synCfg.getAxisConfiguration();
        if (axisConfig != null) {

            if (targetInLineInSequence != null) {
                targetInLineInSequence.destroy();
            }
            if (targetInLineOutSequence != null) {
                targetInLineOutSequence.destroy();
            }
            if (targetInLineFaultSequence != null) {
                targetInLineFaultSequence.destroy();
            }

            try {
                AxisService as = axisConfig.getService(this.getName());
                if (as != null) {
                    as.setActive(false);
                    axisConfig.notifyObservers(new AxisEvent(AxisEvent.SERVICE_STOP, as), as);
                }
                this.setRunning(false);
                auditInfo("Stopped the proxy service : " + name);
            } catch (AxisFault axisFault) {
                handleException("Error stopping the proxy service : " + name, axisFault);
View Full Code Here

                            Boolean.parseBoolean(preserveAddressingProperty)));
        }


        ConfigurationContext axisCfgCtx = axisOutMsgCtx.getConfigurationContext();
        AxisConfiguration axisCfg       = axisCfgCtx.getAxisConfiguration();

        AxisService anoymousService =
            AnonymousServiceFactory.getAnonymousService(synapseOutMessageContext.getConfiguration(),
            axisCfg, wsAddressingEnabled, wsRMEnabled, wsSecurityEnabled);
        // mark the anon services created to be used in the client side of synapse as hidden
View Full Code Here

                    "Components of the proxy service may not be initialized");
            }

            AxisService as = axisConfig.getServiceForActivation(this.getName());
            as.setActive(true);
            axisConfig.notifyObservers(new AxisEvent(AxisEvent.SERVICE_START, as), as);
            this.setRunning(true);
            auditInfo("Started the proxy service : " + name);
        } else {
            auditWarn("Unable to start proxy service : " + name +
                ". Couldn't access Axis configuration");
View Full Code Here

TOP

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

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.