com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver.Parser Java Examples
The following examples show how to use
com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver.Parser.
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 TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { if (systemId != null) { SDDocumentSource doc = metadata.get(systemId); if (doc != null) return new Parser(doc); } if (resolver != null) { try { InputSource source = resolver.resolveEntity(publicId, systemId); if (source != null) { Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); return p; } } catch (SAXException e) { throw new XMLStreamException(e); } } return null; }
Example #2
Source File: EndpointFactory.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { if (systemId != null) { SDDocumentSource doc = metadata.get(systemId); if (doc != null) return new Parser(doc); } if (resolver != null) { try { InputSource source = resolver.resolveEntity(publicId, systemId); if (source != null) { Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); return p; } } catch (SAXException e) { throw new XMLStreamException(e); } } return null; }
Example #3
Source File: EndpointFactory.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { if (systemId != null) { SDDocumentSource doc = metadata.get(systemId); if (doc != null) return new Parser(doc); } if (resolver != null) { try { InputSource source = resolver.resolveEntity(publicId, systemId); if (source != null) { Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); return p; } } catch (SAXException e) { throw new XMLStreamException(e); } } return null; }
Example #4
Source File: EndpointFactory.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { if (systemId != null) { SDDocumentSource doc = metadata.get(systemId); if (doc != null) return new Parser(doc); } if (resolver != null) { try { InputSource source = resolver.resolveEntity(publicId, systemId); if (source != null) { Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); return p; } } catch (SAXException e) { throw new XMLStreamException(e); } } return null; }
Example #5
Source File: EndpointFactory.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { if (systemId != null) { SDDocumentSource doc = metadata.get(systemId); if (doc != null) return new Parser(doc); } if (resolver != null) { try { InputSource source = resolver.resolveEntity(publicId, systemId); if (source != null) { Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); return p; } } catch (SAXException e) { throw new XMLStreamException(e); } } return null; }
Example #6
Source File: EndpointFactory.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { if (systemId != null) { SDDocumentSource doc = metadata.get(systemId); if (doc != null) return new Parser(doc); } if (resolver != null) { try { InputSource source = resolver.resolveEntity(publicId, systemId); if (source != null) { Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); return p; } } catch (SAXException e) { throw new XMLStreamException(e); } } return null; }
Example #7
Source File: EndpointFactory.java From hottub with GNU General Public License v2.0 | 6 votes |
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { if (systemId != null) { SDDocumentSource doc = metadata.get(systemId); if (doc != null) return new Parser(doc); } if (resolver != null) { try { InputSource source = resolver.resolveEntity(publicId, systemId); if (source != null) { Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); return p; } } catch (SAXException e) { throw new XMLStreamException(e); } } return null; }
Example #8
Source File: RuntimeWSDLParser.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
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 #9
Source File: RuntimeWSDLParser.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
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 #10
Source File: RuntimeWSDLParser.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
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-8-source with GNU General Public License v2.0 | 5 votes |
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 #12
Source File: RuntimeWSDLParser.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
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 #13
Source File: RuntimeWSDLParser.java From hottub with GNU General Public License v2.0 | 5 votes |
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 hottub with GNU General Public License v2.0 | 5 votes |
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 #15
Source File: RuntimeWSDLParser.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
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 #16
Source File: RuntimeWSDLParser.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
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 #17
Source File: EndpointFactory.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { if (systemId != null) { SDDocumentSource doc = metadata.get(systemId); if (doc != null) return new Parser(doc); synchronized(this) { while(origMetadata.hasNext()) { doc = origMetadata.next(); String extForm = doc.getSystemId().toExternalForm(); this.metadata.put(extForm,doc); if (systemId.equals(extForm)) return new Parser(doc); } } } if (resolver != null) { try { InputSource source = resolver.resolveEntity(publicId, systemId); if (source != null) { Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); return p; } } catch (SAXException e) { throw new XMLStreamException(e); } } return null; }
Example #18
Source File: RuntimeWSDLParser.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
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 #19
Source File: RuntimeWSDLParser.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
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 #20
Source File: RuntimeWSDLParser.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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 #21
Source File: RuntimeWSDLParser.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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 #22
Source File: RuntimeWSDLParser.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
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 #23
Source File: RuntimeWSDLParser.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
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 TencentKona-8 with GNU General Public License v2.0 | 5 votes |
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 #25
Source File: RuntimeWSDLParser.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
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 #26
Source File: RuntimeWSDLParser.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
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 #27
Source File: RuntimeWSDLParser.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
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 #28
Source File: RuntimeWSDLParser.java From hottub with GNU General Public License v2.0 | 4 votes |
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 #29
Source File: RuntimeWSDLParser.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
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 #30
Source File: RuntimeWSDLParser.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
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(); } }