com.sun.xml.internal.ws.model.AbstractSEIModelImpl Java Examples

The following examples show how to use com.sun.xml.internal.ws.model.AbstractSEIModelImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EndpointFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
Example #2
Source File: EndpointFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
Example #3
Source File: EndpointFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
Example #4
Source File: EndpointFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
Example #5
Source File: EndpointFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
Example #6
Source File: EndpointFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
Example #7
Source File: EndpointFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
Example #8
Source File: EndpointFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
Example #9
Source File: EndpointFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #10
Source File: EndpointFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #11
Source File: EndpointFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #12
Source File: WSDLGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #13
Source File: EndpointFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #14
Source File: WSDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #15
Source File: WSDLGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #16
Source File: EndpointFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #17
Source File: WSDLGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #18
Source File: EndpointFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, Collection<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #19
Source File: EndpointFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #20
Source File: WSDLGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #21
Source File: WSDLGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #22
Source File: EndpointFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #23
Source File: WSDLGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #24
Source File: WSDLGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #25
Source File: ServiceArtifactSchemaGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public ServiceArtifactSchemaGenerator(SEIModel model) {
    this.model = (AbstractSEIModelImpl)model;
}
 
Example #26
Source File: SEIInvokerTube.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public SEIInvokerTube(AbstractSEIModelImpl model,Invoker invoker, WSBinding binding) {
    super(invoker);
    this.binding = binding;
    this.model = model;
}
 
Example #27
Source File: EndpointFactory.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected EndpointAwareTube createSEIInvokerTube(AbstractSEIModelImpl seiModel, Invoker invoker, WSBinding binding) {
    return new SEIInvokerTube(seiModel,invoker,binding);
}
 
Example #28
Source File: ServerLogicalHandlerTube.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private BindingContext getBindingContext() {
return (seiModel!= null && seiModel instanceof AbstractSEIModelImpl) ?
        ((AbstractSEIModelImpl)seiModel).getBindingContext() : null;
}
 
Example #29
Source File: ClientLogicalHandlerTube.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private BindingContext getBindingContext() {
return (seiModel!= null && seiModel instanceof AbstractSEIModelImpl) ?
        ((AbstractSEIModelImpl)seiModel).getBindingContext() : null;
}
 
Example #30
Source File: EndpointFactory.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected EndpointAwareTube createSEIInvokerTube(AbstractSEIModelImpl seiModel, Invoker invoker, WSBinding binding) {
    return new SEIInvokerTube(seiModel,invoker,binding);
}