com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension. 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-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 #2
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 #3
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 #4
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 #5
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 #6
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 #7
Source File: WSDLGeneratorExtensionFacade.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void addServiceExtension(TypedXmlWriter service) {
    for (WSDLGeneratorExtension e : extensions)
        e.addServiceExtension(service);
}
 
Example #8
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void addBindingOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
    for (WSDLGeneratorExtension e : extensions)
        e.addBindingOperationFaultExtension(fault, method, ce);
}
 
Example #9
Source File: WSDLGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void register(WSDLGeneratorExtension h) {
    extensionHandlers.add(h);
}
 
Example #10
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void addPortExtension(TypedXmlWriter port) {
    for (WSDLGeneratorExtension e : extensions)
        e.addPortExtension(port);
}
 
Example #11
Source File: WSDLGeneratorExtensionFacade.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void addBindingExtension(TypedXmlWriter binding) {
    for (WSDLGeneratorExtension e : extensions)
        e.addBindingExtension(binding);
}
 
Example #12
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void addOutputMessageExtension(TypedXmlWriter message, JavaMethod method) {
    for (WSDLGeneratorExtension e : extensions)
        e.addOutputMessageExtension(message, method);
}
 
Example #13
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void addBindingExtension(TypedXmlWriter binding) {
    for (WSDLGeneratorExtension e : extensions)
        e.addBindingExtension(binding);
}
 
Example #14
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void addFaultMessageExtension(TypedXmlWriter message, JavaMethod method, CheckedException ce) {
    for (WSDLGeneratorExtension e : extensions)
        e.addFaultMessageExtension(message, method, ce);
}
 
Example #15
Source File: WSDLGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void register(WSDLGeneratorExtension h) {
    extensionHandlers.add(h);
}
 
Example #16
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void addBindingExtension(TypedXmlWriter binding) {
    for (WSDLGeneratorExtension e : extensions)
        e.addBindingExtension(binding);
}
 
Example #17
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void start(WSDLGenExtnContext ctxt) {
    for (WSDLGeneratorExtension e : extensions)
        e.start(ctxt);
}
 
Example #18
Source File: WSDLGeneratorExtensionFacade.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void addOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
    for (WSDLGeneratorExtension e : extensions)
        e.addOperationInputExtension(input, method);
}
 
Example #19
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void addBindingOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
    for (WSDLGeneratorExtension e : extensions)
        e.addBindingOperationOutputExtension(output, method);
}
 
Example #20
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void end(@NotNull WSDLGenExtnContext ctxt) {
    for (WSDLGeneratorExtension e : extensions)
        e.end(ctxt);
}
 
Example #21
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
WSDLGeneratorExtensionFacade(WSDLGeneratorExtension... extensions) {
    assert extensions!=null;
    this.extensions = extensions;
}
 
Example #22
Source File: WSDLGenInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void setExtensions(WSDLGeneratorExtension[] extensions) {
        this.extensions = extensions;
}
 
Example #23
Source File: WSDLGenInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public WSDLGeneratorExtension[] getExtensions() {
    if (extensions == null) return new WSDLGeneratorExtension[0];
        return extensions;
}
 
Example #24
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void addInputMessageExtension(TypedXmlWriter message, JavaMethod method) {
    for (WSDLGeneratorExtension e : extensions)
        e.addInputMessageExtension(message, method);
}
 
Example #25
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void addOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
    for (WSDLGeneratorExtension e : extensions)
        e.addOperationInputExtension(input, method);
}
 
Example #26
Source File: WSDLGeneratorExtensionFacade.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void addOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
    for (WSDLGeneratorExtension e : extensions)
        e.addOperationFaultExtension(fault, method, ce);
}
 
Example #27
Source File: WSDLGeneratorExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void addFaultMessageExtension(TypedXmlWriter message, JavaMethod method, CheckedException ce) {
    for (WSDLGeneratorExtension e : extensions)
        e.addFaultMessageExtension(message, method, ce);
}
 
Example #28
Source File: WSDLGeneratorExtensionFacade.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void addBindingOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
    for (WSDLGeneratorExtension e : extensions)
        e.addBindingOperationFaultExtension(fault, method, ce);
}
 
Example #29
Source File: WSDLGeneratorExtensionFacade.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void addBindingOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
    for (WSDLGeneratorExtension e : extensions)
        e.addBindingOperationOutputExtension(output, method);
}
 
Example #30
Source File: WSDLGeneratorExtensionFacade.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void addBindingOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
    for (WSDLGeneratorExtension e : extensions)
        e.addBindingOperationInputExtension(input, method);
}