com.sun.xml.internal.ws.resources.WsdlmodelMessages Java Examples

The following examples show how to use com.sun.xml.internal.ws.resources.WsdlmodelMessages. 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 4 votes vote down vote up
private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
    XMLStreamReader reader = parser.parser;
    try {
        // avoid processing the same WSDL twice.
        // if no system ID is given, the check won't work
        if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
            return;

        if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        if (WSDLConstants.QNAME_DEFINITIONS.equals(reader.getName())) {
            readNSDecl(wsdldef_nsdecl, reader);
        }
        if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
            if (imported) {
                // wsdl:import could be a schema. Relaxing BP R2001 requirement.
                LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
                return;
            }
        }

        //get the targetNamespace of the service
        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);

        final String oldTargetNamespace = targetNamespace;
        targetNamespace = tns;

        while (XMLStreamReaderUtil.nextElementContent(reader) !=
                XMLStreamConstants.END_ELEMENT) {
            if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                break;

            QName name = reader.getName();
            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
                parseImport(parser.systemId, reader);
            } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
                parseMessage(reader);
            } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
                parsePortType(reader);
            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
                parseBinding(reader);
            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
                parseService(reader);
            } else {
                extensionFacade.definitionsElements(reader);
            }
        }
        targetNamespace = oldTargetNamespace;
    } finally {
        this.wsdldef_nsdecl = new HashMap<String,String>();
        reader.close();
    }
}
 
Example #2
Source File: RuntimeWSDLParser.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
    XMLStreamReader reader = parser.parser;
    try {
        // avoid processing the same WSDL twice.
        // if no system ID is given, the check won't work
        if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
            return;

        if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        if (WSDLConstants.QNAME_DEFINITIONS.equals(reader.getName())) {
            readNSDecl(wsdldef_nsdecl, reader);
        }
        if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
            if (imported) {
                // wsdl:import could be a schema. Relaxing BP R2001 requirement.
                LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
                return;
            }
        }

        //get the targetNamespace of the service
        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);

        final String oldTargetNamespace = targetNamespace;
        targetNamespace = tns;

        while (XMLStreamReaderUtil.nextElementContent(reader) !=
                XMLStreamConstants.END_ELEMENT) {
            if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                break;

            QName name = reader.getName();
            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
                parseImport(parser.systemId, reader);
            } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
                parseMessage(reader);
            } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
                parsePortType(reader);
            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
                parseBinding(reader);
            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
                parseService(reader);
            } else {
                extensionFacade.definitionsElements(reader);
            }
        }
        targetNamespace = oldTargetNamespace;
    } finally {
        this.wsdldef_nsdecl = new HashMap<String,String>();
        reader.close();
    }
}
 
Example #3
Source File: RuntimeWSDLParser.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
    XMLStreamReader reader = parser.parser;
    try {
        // avoid processing the same WSDL twice.
        // if no system ID is given, the check won't work
        if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
            return;

        if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        if (WSDLConstants.QNAME_DEFINITIONS.equals(reader.getName())) {
            readNSDecl(wsdldef_nsdecl, reader);
        }
        if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
            if (imported) {
                // wsdl:import could be a schema. Relaxing BP R2001 requirement.
                LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
                return;
            }
        }

        //get the targetNamespace of the service
        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);

        final String oldTargetNamespace = targetNamespace;
        targetNamespace = tns;

        while (XMLStreamReaderUtil.nextElementContent(reader) !=
                XMLStreamConstants.END_ELEMENT) {
            if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                break;

            QName name = reader.getName();
            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
                parseImport(parser.systemId, reader);
            } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
                parseMessage(reader);
            } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
                parsePortType(reader);
            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
                parseBinding(reader);
            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
                parseService(reader);
            } else {
                extensionFacade.definitionsElements(reader);
            }
        }
        targetNamespace = oldTargetNamespace;
    } finally {
        this.wsdldef_nsdecl = new HashMap<String,String>();
        reader.close();
    }
}
 
Example #4
Source File: RuntimeWSDLParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
    XMLStreamReader reader = parser.parser;
    try {
        // avoid processing the same WSDL twice.
        // if no system ID is given, the check won't work
        if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
            return;

        if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        if (WSDLConstants.QNAME_DEFINITIONS.equals(reader.getName())) {
            readNSDecl(wsdldef_nsdecl, reader);
        }
        if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
            if (imported) {
                // wsdl:import could be a schema. Relaxing BP R2001 requirement.
                LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
                return;
            }
        }

        //get the targetNamespace of the service
        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);

        final String oldTargetNamespace = targetNamespace;
        targetNamespace = tns;

        while (XMLStreamReaderUtil.nextElementContent(reader) !=
                XMLStreamConstants.END_ELEMENT) {
            if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                break;

            QName name = reader.getName();
            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
                parseImport(parser.systemId, reader);
            } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
                parseMessage(reader);
            } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
                parsePortType(reader);
            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
                parseBinding(reader);
            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
                parseService(reader);
            } else {
                extensionFacade.definitionsElements(reader);
            }
        }
        targetNamespace = oldTargetNamespace;
    } finally {
        this.wsdldef_nsdecl = new HashMap<String,String>();
        reader.close();
    }
}
 
Example #5
Source File: RuntimeWSDLParser.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
    XMLStreamReader reader = parser.parser;
    try {
        // avoid processing the same WSDL twice.
        // if no system ID is given, the check won't work
        if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
            return;

        if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        if (WSDLConstants.QNAME_DEFINITIONS.equals(reader.getName())) {
            readNSDecl(wsdldef_nsdecl, reader);
        }
        if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
            if (imported) {
                // wsdl:import could be a schema. Relaxing BP R2001 requirement.
                LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
                return;
            }
        }

        //get the targetNamespace of the service
        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);

        final String oldTargetNamespace = targetNamespace;
        targetNamespace = tns;

        while (XMLStreamReaderUtil.nextElementContent(reader) !=
                XMLStreamConstants.END_ELEMENT) {
            if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                break;

            QName name = reader.getName();
            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
                parseImport(parser.systemId, reader);
            } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
                parseMessage(reader);
            } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
                parsePortType(reader);
            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
                parseBinding(reader);
            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
                parseService(reader);
            } else {
                extensionFacade.definitionsElements(reader);
            }
        }
        targetNamespace = oldTargetNamespace;
    } finally {
        this.wsdldef_nsdecl = new HashMap<String,String>();
        reader.close();
    }
}
 
Example #6
Source File: RuntimeWSDLParser.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
    XMLStreamReader reader = parser.parser;
    try {
        // avoid processing the same WSDL twice.
        // if no system ID is given, the check won't work
        if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
            return;

        if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        if (WSDLConstants.QNAME_DEFINITIONS.equals(reader.getName())) {
            readNSDecl(wsdldef_nsdecl, reader);
        }
        if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
            if (imported) {
                // wsdl:import could be a schema. Relaxing BP R2001 requirement.
                LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
                return;
            }
        }

        //get the targetNamespace of the service
        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);

        final String oldTargetNamespace = targetNamespace;
        targetNamespace = tns;

        while (XMLStreamReaderUtil.nextElementContent(reader) !=
                XMLStreamConstants.END_ELEMENT) {
            if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                break;

            QName name = reader.getName();
            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
                parseImport(parser.systemId, reader);
            } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
                parseMessage(reader);
            } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
                parsePortType(reader);
            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
                parseBinding(reader);
            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
                parseService(reader);
            } else {
                extensionFacade.definitionsElements(reader);
            }
        }
        targetNamespace = oldTargetNamespace;
    } finally {
        this.wsdldef_nsdecl = new HashMap<String,String>();
        reader.close();
    }
}
 
Example #7
Source File: RuntimeWSDLParser.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
    XMLStreamReader reader = parser.parser;
    try {
        // avoid processing the same WSDL twice.
        // if no system ID is given, the check won't work
        if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
            return;

        if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        if (WSDLConstants.QNAME_DEFINITIONS.equals(reader.getName())) {
            readNSDecl(wsdldef_nsdecl, reader);
        }
        if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
            if (imported) {
                // wsdl:import could be a schema. Relaxing BP R2001 requirement.
                LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
                return;
            }
        }

        //get the targetNamespace of the service
        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);

        final String oldTargetNamespace = targetNamespace;
        targetNamespace = tns;

        while (XMLStreamReaderUtil.nextElementContent(reader) !=
                XMLStreamConstants.END_ELEMENT) {
            if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                break;

            QName name = reader.getName();
            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
                parseImport(parser.systemId, reader);
            } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
                parseMessage(reader);
            } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
                parsePortType(reader);
            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
                parseBinding(reader);
            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
                parseService(reader);
            } else {
                extensionFacade.definitionsElements(reader);
            }
        }
        targetNamespace = oldTargetNamespace;
    } finally {
        this.wsdldef_nsdecl = new HashMap<String,String>();
        reader.close();
    }
}
 
Example #8
Source File: RuntimeWSDLParser.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
    XMLStreamReader reader = parser.parser;
    try {
        // avoid processing the same WSDL twice.
        // if no system ID is given, the check won't work
        if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
            return;

        if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        if (WSDLConstants.QNAME_DEFINITIONS.equals(reader.getName())) {
            readNSDecl(wsdldef_nsdecl, reader);
        }
        if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
            if (imported) {
                // wsdl:import could be a schema. Relaxing BP R2001 requirement.
                LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
                return;
            }
        }

        //get the targetNamespace of the service
        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);

        final String oldTargetNamespace = targetNamespace;
        targetNamespace = tns;

        while (XMLStreamReaderUtil.nextElementContent(reader) !=
                XMLStreamConstants.END_ELEMENT) {
            if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                break;

            QName name = reader.getName();
            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
                parseImport(parser.systemId, reader);
            } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
                parseMessage(reader);
            } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
                parsePortType(reader);
            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
                parseBinding(reader);
            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
                parseService(reader);
            } else {
                extensionFacade.definitionsElements(reader);
            }
        }
        targetNamespace = oldTargetNamespace;
    } finally {
        this.wsdldef_nsdecl = new HashMap<String,String>();
        reader.close();
    }
}