com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension. 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: RuntimeWSDLParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private RuntimeWSDLParser(@NotNull String sourceLocation, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) {
    this.wsdlDoc = sourceLocation!=null ? new WSDLModelImpl(sourceLocation) : new WSDLModelImpl();
    this.resolver = resolver;
    this.policyResolver = policyResolver;
    this.extensions = new ArrayList<WSDLParserExtension>();
    this.context = new WSDLParserExtensionContextImpl(wsdlDoc, isClientSide, container, policyResolver);

    boolean isPolicyExtensionFound = false;
    for (WSDLParserExtension e : extensions) {
            if (e instanceof com.sun.xml.internal.ws.api.wsdl.parser.PolicyWSDLParserExtension)
                    isPolicyExtensionFound = true;
        register(e);
    }

    // register handlers for default extensions
    if (!isPolicyExtensionFound)
            register(new PolicyWSDLParserExtension());
    register(new MemberSubmissionAddressingWSDLParserExtension());
    register(new W3CAddressingWSDLParserExtension());
    register(new W3CAddressingMetadataWSDLParserExtension());

    this.extensionFacade =  new WSDLParserExtensionFacade(this.extensions.toArray(new WSDLParserExtension[0]));
}
 
Example #2
Source File: WSDLParserExtensionFacade.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean definitionsElements(XMLStreamReader reader){
    for (WSDLParserExtension e : extensions) {
        if (e.definitionsElements(reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #3
Source File: WSDLParserExtensionFacade.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean portTypeElements(EditableWSDLPortType portType, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.portTypeElements(portType, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #4
Source File: WSDLParserExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public boolean bindingOperationInputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.bindingOperationInputElements(operation, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #5
Source File: WSDLParserExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public boolean portTypeOperationFaultElements(EditableWSDLFault fault, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.portTypeOperationFaultElements(fault, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #6
Source File: WSDLParserExtensionFacade.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader){
    for (WSDLParserExtension e : extensions) {
        if (e.bindingElements(binding, reader)) {
            return true;
        }
    }
    //extension is not understood by any WSDlParserExtension
    //Check if it must be understood.
    if (isRequiredExtension(reader)) {
        binding.addNotUnderstoodExtension(
                reader.getName(), getLocator(reader));
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #7
Source File: WSDLParserExtensionFacade.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public boolean bindingOperationInputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.bindingOperationInputElements(operation, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #8
Source File: WSDLParserExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public boolean bindingOperationFaultElements(EditableWSDLBoundFault fault, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.bindingOperationFaultElements(fault, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #9
Source File: WSDLParserExtensionFacade.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public boolean messageElements(EditableWSDLMessage msg, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.messageElements(msg, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #10
Source File: RuntimeWSDLParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;
    RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, policyResolver, extensions);
    parser.extensionFacade.start(parser.context);
    parser.parseWSDL(wsdl, false);
    parser.wsdlDoc.freeze();
    parser.extensionFacade.finished(parser.context);
    parser.extensionFacade.postFinished(parser.context);
    return parser.wsdlDoc;
}
 
Example #11
Source File: RuntimeWSDLParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;
    RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, policyResolver, extensions);
    parser.extensionFacade.start(parser.context);
    parser.parseWSDL(wsdl, false);
    parser.wsdlDoc.freeze();
    parser.extensionFacade.finished(parser.context);
    parser.extensionFacade.postFinished(parser.context);
    return parser.wsdlDoc;
}
 
Example #12
Source File: WSDLParserExtensionFacade.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public boolean messageElements(EditableWSDLMessage msg, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.messageElements(msg, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #13
Source File: RuntimeWSDLParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;
    RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, PolicyResolverFactory.create(), extensions);
    parser.extensionFacade.start(parser.context);
    parser.parseWSDL(wsdl, false);
    parser.wsdlDoc.freeze();
    parser.extensionFacade.finished(parser.context);
    parser.extensionFacade.postFinished(parser.context);
    return parser.wsdlDoc;
}
 
Example #14
Source File: RuntimeWSDLParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;
    RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, PolicyResolverFactory.create(), extensions);
    parser.extensionFacade.start(parser.context);
    parser.parseWSDL(wsdl, false);
    parser.wsdlDoc.freeze();
    parser.extensionFacade.finished(parser.context);
    parser.extensionFacade.postFinished(parser.context);
    return parser.wsdlDoc;
}
 
Example #15
Source File: WSDLParserExtensionFacade.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean messageElements(EditableWSDLMessage msg, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.messageElements(msg, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #16
Source File: WSDLParserExtensionFacade.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean bindingOperationOutputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.bindingOperationOutputElements(operation, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #17
Source File: WSDLParserExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public boolean bindingOperationOutputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.bindingOperationOutputElements(operation, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #18
Source File: WSDLParserExtensionFacade.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public boolean portTypeElements(EditableWSDLPortType portType, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.portTypeElements(portType, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #19
Source File: WSDLParserExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public boolean portTypeElements(EditableWSDLPortType portType, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.portTypeElements(portType, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #20
Source File: RuntimeWSDLParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;
    RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, policyResolver, extensions);
    parser.extensionFacade.start(parser.context);
    parser.parseWSDL(wsdl, false);
    parser.wsdlDoc.freeze();
    parser.extensionFacade.finished(parser.context);
    parser.extensionFacade.postFinished(parser.context);
    return parser.wsdlDoc;
}
 
Example #21
Source File: RuntimeWSDLParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;
    RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, PolicyResolverFactory.create(), extensions);
    parser.extensionFacade.start(parser.context);
    parser.parseWSDL(wsdl, false);
    parser.wsdlDoc.freeze();
    parser.extensionFacade.finished(parser.context);
    parser.extensionFacade.postFinished(parser.context);
    return parser.wsdlDoc;
}
 
Example #22
Source File: WSDLParserExtensionFacade.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public boolean bindingOperationFaultElements(EditableWSDLBoundFault fault, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        if (e.bindingOperationFaultElements(fault, reader)) {
            return true;
        }
    }
    XMLStreamReaderUtil.skipElement(reader);
    return true;
}
 
Example #23
Source File: RuntimeWSDLParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;
    RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, policyResolver, extensions);
    parser.extensionFacade.start(parser.context);
    parser.parseWSDL(wsdl, false);
    parser.wsdlDoc.freeze();
    parser.extensionFacade.finished(parser.context);
    parser.extensionFacade.postFinished(parser.context);
    return parser.wsdlDoc;
}
 
Example #24
Source File: RuntimeWSDLParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;
    RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, policyResolver, extensions);
    parser.extensionFacade.start(parser.context);
    parser.parseWSDL(wsdl, false);
    parser.wsdlDoc.freeze();
    parser.extensionFacade.finished(parser.context);
    parser.extensionFacade.postFinished(parser.context);
    return parser.wsdlDoc;
}
 
Example #25
Source File: RuntimeWSDLParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the WSDL and gives WSDLModel. If wsdl parameter is null, then wsdlLoc is used to get the WSDL. If the WSDL
 * document could not be obtained then {@link MetadataResolverFactory} is tried to get the WSDL document, if not found
 * then as last option, if the wsdlLoc has no '?wsdl' as query parameter then it is tried by appending '?wsdl'.
 *
 * @param wsdlLoc
 *      Either this or <tt>wsdl</tt> parameter must be given.
 *      Null location means the system won't be able to resolve relative references in the WSDL,
 */
public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver,
                                  boolean isClientSide, Container container, Class serviceClass,
                                  @NotNull PolicyResolver policyResolver,
                                  boolean isUseStreamFromEntityResolverWrapper,
                                  WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;

    RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver, isUseStreamFromEntityResolverWrapper), isClientSide, container, policyResolver, extensions);
    Parser parser;
    try{
        parser = wsdlParser.resolveWSDL(wsdlLoc, wsdlSource, serviceClass);
        if(!hasWSDLDefinitions(parser.parser)){
            throw new XMLStreamException(ClientMessages.RUNTIME_WSDLPARSER_INVALID_WSDL(parser.systemId,
                    WSDLConstants.QNAME_DEFINITIONS, parser.parser.getName(), parser.parser.getLocation()));
        }
    }catch(XMLStreamException e){
        //Try MEX if there is WSDLLoc available
        if(wsdlLoc == null)
            throw e;
        return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);

    }catch(IOException e){
        //Try MEX if there is WSDLLoc available
        if(wsdlLoc == null)
            throw e;
        return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);
    }
    wsdlParser.extensionFacade.start(wsdlParser.context);
    wsdlParser.parseWSDL(parser, false);
    wsdlParser.wsdlDoc.freeze();
    wsdlParser.extensionFacade.finished(wsdlParser.context);
    wsdlParser.extensionFacade.postFinished(wsdlParser.context);

    if(wsdlParser.wsdlDoc.getServices().isEmpty())
        throw new WebServiceException(ClientMessages.WSDL_CONTAINS_NO_SERVICE(wsdlLoc));

    return wsdlParser.wsdlDoc;
}
 
Example #26
Source File: WSDLParserExtensionFacade.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void start(WSDLParserExtensionContext context) {
    for (WSDLParserExtension e : extensions) {
        e.start(context);
    }
}
 
Example #27
Source File: WSDLParserExtensionFacade.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void portTypeOperationInputAttributes(EditableWSDLInput input, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        e.portTypeOperationInputAttributes(input, reader);
    }
}
 
Example #28
Source File: WSDLParserExtensionFacade.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void portTypeOperationOutputAttributes(EditableWSDLOutput output, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        e.portTypeOperationOutputAttributes(output, reader);
    }
}
 
Example #29
Source File: WSDLParserExtensionFacade.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void portTypeOperationOutputAttributes(EditableWSDLOutput output, XMLStreamReader reader) {
    for (WSDLParserExtension e : extensions) {
        e.portTypeOperationOutputAttributes(output, reader);
    }
}
 
Example #30
Source File: WSDLParserExtensionFacade.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void start(WSDLParserExtensionContext context) {
    for (WSDLParserExtension e : extensions) {
        e.start(context);
    }
}