Package org.apache.axis2.description

Examples of org.apache.axis2.description.WSDL2AxisServiceBuilder


        this.transportIn = transportIn;
        this.ssl = ssl;
    }

    public void build() throws AxisFault {
        Parameter param = transportIn.getParameter(TransportListener.PARAM_PORT);
        if (param != null) {
            port = Integer.parseInt((String) param.getValue());
        }

        int portOffset = 0;

        try {
            portOffset = Integer.parseInt(System.getProperty(NhttpConstants.PORT_OFFSET, "0"));
        } catch (NumberFormatException e) {
            handleException("portOffset System property should be a valid Integer", e);
        }

        port = port + portOffset;

        param = transportIn.getParameter(NhttpConstants.BIND_ADDRESS);
        if (param != null) {
            bindAddress = ((String) param.getValue()).trim();
        }

        param = transportIn.getParameter(TransportListener.HOST_ADDRESS);
        if (param != null) {
            host = ((String) param.getValue()).trim();
        } else {
            try {
                host = InetAddress.getLocalHost().getHostName();
            } catch (UnknownHostException e) {
                log.warn("Unable to lookup local host name, using 'localhost'");
            }
        }

        metrics = new NhttpMetricsCollector(true, ssl);

        // create the priority based executor and parser
        param = transportIn.getParameter(NhttpConstants.PRIORITY_CONFIG_FILE_NAME);
        if (param != null && param.getValue() != null) {
            createPriorityConfiguration(param.getValue().toString());
        }

        param = transportIn.getParameter(NhttpConstants.DISABLE_REST_SERVICE_DISPATCHING);
        if (param != null && param.getValue() != null) {
            if (param.getValue().equals("true")) {
                restDispatching = false;
            }
        }

        // create http Get processor
        param = transportIn.getParameter(NhttpConstants.HTTP_GET_PROCESSOR);
        if (param != null && param.getValue() != null) {
            httpGetRequestProcessor = createHttpGetProcessor(param.getValue().toString());
            if (httpGetRequestProcessor == null) {
                handleException("Cannot create HttpGetRequestProcessor");
            }
        } else {
            httpGetRequestProcessor = new DefaultHttpGetProcessor();
        }

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here


            handleException("Error processing POST request ", e);
        }
    }

    private String inferContentType() {
        Parameter param = cfgCtx.getAxisConfiguration().
                getParameter(NhttpConstants.REQUEST_CONTENT_TYPE);
        if (param != null) {
            return param.getValue().toString();
        }
        return null;
    }
View Full Code Here

        sslContext = getSSLContext(transportOut);
        sslIOSessionHandler = getSSLIOSessionHandler(transportOut);

        // configure proxy settings - only supports HTTP right now (See SYNAPSE-418)
        if (sslContext == null) {
            Parameter proxyHostParam = transportOut.getParameter("http.proxyHost");
            if (proxyHostParam != null || System.getProperty("http.proxyHost") != null) {
                if (proxyHostParam != null) {
                    proxyHost = (String) proxyHostParam.getValue();
                } else {
                    proxyHost = System.getProperty("http.proxyHost");
                }

                Parameter proxyPortParam = transportOut.getParameter("http.proxyPort");
                if (proxyPortParam != null) {
                    proxyPort = Integer.parseInt((String) proxyPortParam.getValue());
                } else if (System.getProperty("http.proxyPort") != null) {
                    proxyPort = Integer.parseInt(System.getProperty("http.proxyPort"));
                }

                Parameter bypassList = transportOut.getParameter("http.nonProxyHosts");
                if (bypassList != null) {
                    proxyBypassList = ((String) bypassList.getValue()).split("\\|");
                } else if (System.getProperty("http.nonProxyHosts") != null) {
                    proxyBypassList = (System.getProperty("http.nonProxyHosts")).split("\\|");
                }

                log.info("HTTP Sender using Proxy : "
                    + proxyHost + ":" + proxyPort + " bypassing : " + Arrays.toString(proxyBypassList));
            }
        }
       
        Parameter param = transportOut.getParameter("warnOnHTTP500");
        if (param != null) {
            String[] warnOnHttp500 = ((String) param.getValue()).split("\\|");
            cfgCtx.setNonReplicableProperty("warnOnHTTP500", warnOnHttp500);
        }

        preserveUserAgentHeader = NHttpConfiguration.getInstance().isPreserveUserAgentHeader();
        preserveServerHeader = NHttpConfiguration.getInstance().isPreserveServerHeader();
View Full Code Here

            if (tr != null) {
                tr.resolveTarget(outMsgCtx);
            }

            // if the transport to use for sending is not specified, try to find it from the URL
      TransportOutDescription transportOut = options.getTransportOut();
      if (transportOut == null) {
        EndpointReference toEPR =
                    (options.getTo() != null) ? options.getTo() : outMsgCtx.getTo();
        transportOut =
                    ClientUtils.inferOutTransport(cfgCtx.getAxisConfiguration(), toEPR, outMsgCtx);
View Full Code Here

                for (Map.Entry<QName, SDODataBindingTypeMappingEntry> e : typeMapping.entrySet()) {
                    typeMapper.addTypeMappingObject(e.getKey(), e.getValue());
                }
                AxisService axisService;
                try {
                    axisService = new WSDL2AxisServiceBuilder(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

        // AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
        // serviceGroup.setServiceGroupName(wsdlPortInfo.getServiceName().getLocalPart());
        // axisConfig.addServiceGroup(serviceGroup);

        WSDL2AxisServiceBuilder builder = new WSDL2AxisServiceBuilder(definition, wsdlPortInfo.getServiceName(), wsdlPortInfo.getPort().getName());
        builder.setServerSide(true);
        AxisService axisService = builder.populateService();

        axisService.setName(entryPointName);
        // axisService.setParent(serviceGroup);
        axisService.setServiceDescription("Tuscany configured AxisService for EntryPoint: '" + entryPointName + '\'');
View Full Code Here

      }else{
        url = new URL(wsdlURI)
      }

     
      WSDL2AxisServiceBuilder builder =
        new WSDL2AxisServiceBuilder(url.openConnection().getInputStream());
         
      builder.setBaseUri(getBaseUri(wsdlURI));
      return builder.populateService();
    }
View Full Code Here

                            file1.getName().equals("wsat.wsdl") ||
                            file1.getName().equals("no-service.wsdl")) {
                        continue;
                    }
                    try {
                        WSDL2AxisServiceBuilder builder = new WSDL2AxisServiceBuilder(new FileInputStream(file1), null, null);
                        AxisService service = builder.populateService();
                        System.out.println("Testinf file: " + file1.getName());
                        configContext.getAxisConfiguration().addService(service);
                        OutputStream out = new FileOutputStream(new File(outLocation, file1.getName()));
                        service.printWSDL(out, "http://google.com/axis2/services");
                        out.flush();
View Full Code Here

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

            configuration.setAxisService(new WSDL2AxisServiceBuilder(
                    wsdl4jDef,
                    serviceQname,
                    configuration.getPortName()).
                    populateService()
            );
View Full Code Here

     * @throws DeploymentException
     */
    private AxisService processWSDLFile(InputStream in, File serviceArchiveFile,
                                        boolean isArchive) throws DeploymentException {
        try {
            WSDL2AxisServiceBuilder wsdl2AxisServiceBuilder =
                    new WSDL2AxisServiceBuilder(in, null, null);
            if (serviceArchiveFile != null && isArchive) {
                wsdl2AxisServiceBuilder.setCustomResolver(
                        new AARFileBasedURIResolver(serviceArchiveFile));
                wsdl2AxisServiceBuilder.setCustomWSLD4JResolver(
                        new AARBasedWSDLLocator(serviceArchiveFile, in)
                );
            } else {
                if (serviceArchiveFile != null) {
                    wsdl2AxisServiceBuilder.setBaseUri(
                            serviceArchiveFile.getParentFile().getAbsolutePath());
                }
            }
            return wsdl2AxisServiceBuilder.populateService();
        } catch (AxisFault axisFault) {
            throw new DeploymentException(axisFault);
        }
    }
View Full Code Here

TOP

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

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.