Package com.sun.xml.ws.api.databinding

Examples of com.sun.xml.ws.api.databinding.DatabindingConfig


        if (!result) {
            out.println(WscompileMessages.WSCOMPILE_ERROR(WscompileMessages.WSCOMPILE_COMPILATION_FAILED()));
            return false;
        }
        if (options.genWsdl) {
            DatabindingConfig config = new DatabindingConfig();

            List<String> externalMetadataFileNames = options.externalMetadataFiles;
            boolean disableXmlSecurity = options.disableXmlSecurity;
            if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) {
                config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableXmlSecurity));
            }

            String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath;
            ClassLoader classLoader = new URLClassLoader(Options.pathToURLs(tmpPath),
                    this.getClass().getClassLoader());
            Class<?> endpointClass;
            try {
                endpointClass = classLoader.loadClass(endpoint);
            } catch (ClassNotFoundException e) {
                throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_NOT_FOUND(endpoint));
            }

            BindingID bindingID = options.getBindingID(options.protocol);
            if (!options.protocolSet) {
                bindingID = BindingID.parse(endpointClass);
            }
            WebServiceFeatureList wsfeatures = new WebServiceFeatureList(endpointClass);
//            RuntimeModeler rtModeler = new RuntimeModeler(endpointClass, options.serviceName, bindingID, wsfeatures.toArray());
//            rtModeler.setClassLoader(classLoader);
            if (options.portName != null)
                config.getMappingInfo().setPortName(options.portName);//rtModeler.setPortName(options.portName);
//            AbstractSEIModelImpl rtModel = rtModeler.buildRuntimeModel();

            DatabindingFactory fac = DatabindingFactory.newInstance();
            config.setEndpointClass(endpointClass);
            config.getMappingInfo().setServiceName(options.serviceName);
            config.setFeatures(wsfeatures.toArray());
            config.setClassLoader(classLoader);
            config.getMappingInfo().setBindingID(bindingID);
            com.sun.xml.ws.db.DatabindingImpl rt = (com.sun.xml.ws.db.DatabindingImpl) fac.createRuntime(config);

            final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
            final Map<String, File> schemaFiles = new HashMap<String, File>();
View Full Code Here


        return spi;
    }
   
    public SEIModel buildRuntimeModel(QName serviceName, QName portName, Class portInterface, WSDLPort wsdlPort, WebServiceFeatureList features) {
    DatabindingFactory fac = DatabindingFactory.newInstance();
    DatabindingConfig config = new DatabindingConfig();
    config.setContractClass(portInterface);
    config.getMappingInfo().setServiceName(serviceName);
    config.setWsdlPort(wsdlPort);
    config.setFeatures(features);
    config.setClassLoader(portInterface.getClassLoader());
    config.getMappingInfo().setPortName(portName);
    config.setWsdlURL(wsdlURL);
        // if ExternalMetadataFeature present, ExternalMetadataReader will be created ...
        config.setMetadataReader(getMetadadaReader(features, portInterface.getClassLoader()));
   
    com.sun.xml.ws.db.DatabindingImpl rt = (com.sun.xml.ws.db.DatabindingImpl)fac.createRuntime(config);
   
    return rt.getModel();
    }
View Full Code Here

    private static AbstractSEIModelImpl createSEIModel(WSDLPort wsdlPort,
                                                       Class<?> implType, @NotNull QName serviceName, @NotNull QName portName, WSBinding binding,
                                                       SDDocumentSource primaryWsdl) {
    DatabindingFactory fac = DatabindingFactory.newInstance();
    DatabindingConfig config = new DatabindingConfig();
    config.setEndpointClass(implType);
    config.getMappingInfo().setServiceName(serviceName);
    config.setWsdlPort(wsdlPort);
    config.setWSBinding(binding);
    config.setClassLoader(implType.getClassLoader());
    config.getMappingInfo().setPortName(portName);
    if (primaryWsdl != null) config.setWsdlURL(primaryWsdl.getSystemId());
        config.setMetadataReader(getExternalMetadatReader(implType, binding));

    com.sun.xml.ws.db.DatabindingImpl rt = (com.sun.xml.ws.db.DatabindingImpl)fac.createRuntime(config);
    return (AbstractSEIModelImpl) rt.getModel();     
    }
View Full Code Here

    private static AbstractSEIModelImpl createSEIModel(WSDLPort wsdlPort,
                                                       Class<?> implType, @NotNull QName serviceName, @NotNull QName portName, WSBinding binding,
                                                       SDDocumentSource primaryWsdl) {
    DatabindingFactory fac = DatabindingFactory.newInstance();
    DatabindingConfig config = new DatabindingConfig();
    config.setEndpointClass(implType);
    config.getMappingInfo().setServiceName(serviceName);
    config.setWsdlPort(wsdlPort);
    config.setWSBinding(binding);
    config.setClassLoader(implType.getClassLoader());
    config.getMappingInfo().setPortName(portName);
    if (primaryWsdl != null) config.setWsdlURL(primaryWsdl.getSystemId());
        config.setMetadataReader(getExternalMetadatReader(implType, binding));

    com.sun.xml.ws.db.DatabindingImpl rt = (com.sun.xml.ws.db.DatabindingImpl)fac.createRuntime(config);
    return (AbstractSEIModelImpl) rt.getModel();     
    }
View Full Code Here

        DatabindingConfig config;
        DatabindingFactoryImpl factory;
       
        ConfigBuilder(DatabindingFactoryImpl f, Class<?> contractClass, Class<?> implBeanClass) {
            factory = f;
            config = new DatabindingConfig();
            config.setContractClass(contractClass);
            config.setEndpointClass(implBeanClass);
        }
View Full Code Here

        return spi;
    }
   
    public SEIModel buildRuntimeModel(QName serviceName, QName portName, Class portInterface, WSDLPort wsdlPort, WebServiceFeatureList features) {
    DatabindingFactory fac = DatabindingFactory.newInstance();
    DatabindingConfig config = new DatabindingConfig();
    config.setContractClass(portInterface);
    config.getMappingInfo().setServiceName(serviceName);
    config.setWsdlPort(wsdlPort);
    config.setFeatures(features);
    config.setClassLoader(portInterface.getClassLoader());
    config.getMappingInfo().setPortName(portName);
    config.setWsdlURL(wsdlURL);
        // if ExternalMetadataFeature present, ExternalMetadataReader will be created ...
        config.setMetadataReader(getMetadadaReader(features, portInterface.getClassLoader()));
   
    com.sun.xml.ws.db.DatabindingImpl rt = (com.sun.xml.ws.db.DatabindingImpl)fac.createRuntime(config);
   
    return rt.getModel();
    }
View Full Code Here

        if (!result) {
            out.println(WscompileMessages.WSCOMPILE_ERROR(WscompileMessages.WSCOMPILE_COMPILATION_FAILED()));
            return false;
        }
        if (options.genWsdl) {
            DatabindingConfig config = new DatabindingConfig();

            List<String> externalMetadataFileNames = options.externalMetadataFiles;
            boolean disableXmlSecurity = options.disableXmlSecurity;
            if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) {
                config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableXmlSecurity));
            }

            String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath;
            ClassLoader classLoader = new URLClassLoader(Options.pathToURLs(tmpPath),
                    this.getClass().getClassLoader());
            Class<?> endpointClass;
            try {
                endpointClass = classLoader.loadClass(endpoint);
            } catch (ClassNotFoundException e) {
                throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_NOT_FOUND(endpoint));
            }

            BindingID bindingID = options.getBindingID(options.protocol);
            if (!options.protocolSet) {
                bindingID = BindingID.parse(endpointClass);
            }
            WebServiceFeatureList wsfeatures = new WebServiceFeatureList(endpointClass);
//            RuntimeModeler rtModeler = new RuntimeModeler(endpointClass, options.serviceName, bindingID, wsfeatures.toArray());
//            rtModeler.setClassLoader(classLoader);
            if (options.portName != null)
                config.getMappingInfo().setPortName(options.portName);//rtModeler.setPortName(options.portName);
//            AbstractSEIModelImpl rtModel = rtModeler.buildRuntimeModel();

            DatabindingFactory fac = DatabindingFactory.newInstance();
            config.setEndpointClass(endpointClass);
            config.getMappingInfo().setServiceName(options.serviceName);
            config.setFeatures(wsfeatures.toArray());
            config.setClassLoader(classLoader);
            config.getMappingInfo().setBindingID(bindingID);
            com.sun.xml.ws.db.DatabindingImpl rt = (com.sun.xml.ws.db.DatabindingImpl) fac.createRuntime(config);

            final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
            final Map<String, File> schemaFiles = new HashMap<String, File>();
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.api.databinding.DatabindingConfig

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.