Package com.sun.xml.ws.api.wsdl.parser.XMLEntityResolver

Examples of com.sun.xml.ws.api.wsdl.parser.XMLEntityResolver.Parser


                                      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()));
View Full Code Here


            wsdlParser = new RuntimeWSDLParser(wsdlLoc.toExternalForm(), new MexEntityResolver(wsdls), isClientSide, container, policyResolver, extensions);
            wsdlParser.extensionFacade.start(wsdlParser.context);
           
            for(Source src: wsdls ) {
                String systemId = src.getSystemId();
                Parser parser = wsdlParser.resolver.resolveEntity(null, systemId);
                wsdlParser.parseWSDL(parser, false);
            }
        }
        //Incase that mex is not present or it couldn't get the metadata, try by appending ?wsdl and give
        // it a last shot else fail
        if ((mdResolver == null || serviceDescriptor == null) && (wsdlLoc.getProtocol().equals("http") || wsdlLoc.getProtocol().equals("https")) && (wsdlLoc.getQuery() == null)) {
            String urlString = wsdlLoc.toExternalForm();
            urlString += "?wsdl";
            wsdlLoc = new URL(urlString);
            wsdlParser = new RuntimeWSDLParser(wsdlLoc.toExternalForm(),new EntityResolverWrapper(resolver), isClientSide, container, policyResolver, extensions);
            wsdlParser.extensionFacade.start(wsdlParser.context);
            Parser parser = resolveWSDL(wsdlLoc, new StreamSource(wsdlLoc.toExternalForm()), serviceClass);
            wsdlParser.parseWSDL(parser, false);
        }

        if(wsdlParser == null)
            return null;
View Full Code Here

        if (parser == null) {
            //If a WSDL source is provided that is known to be readable, then
            //prioritize that over the URL - this avoids going over the network
            //an additional time if a valid WSDL Source is provided - Deva Sagar 09/20/2011
            if (isKnownReadableSource(wsdlSource)) {
                parser = new Parser(wsdlLoc, createReader(wsdlSource));
            } else if (wsdlLoc != null) {
                parser = new Parser(wsdlLoc, createReader(wsdlLoc, serviceClass));
            }

            //parser could still be null if isKnownReadableSource returns
            //false and wsdlLoc is also null. Fall back to using Source based
            //parser since Source is not null
            if (parser == null) {
                parser = new Parser(wsdlLoc, createReader(wsdlSource));
            }
        }
        return parser;
    }
View Full Code Here

    private void parseImport(@NotNull URL wsdlLoc) throws XMLStreamException, IOException, SAXException {
        String systemId = wsdlLoc.toExternalForm();
        XMLEntityResolver.Parser parser = resolver.resolveEntity(null, systemId);
        if (parser == null) {
            parser = new Parser(wsdlLoc, createReader(wsdlLoc));
        }
        parseWSDL(parser, true);
    }
View Full Code Here

     * @throws SAXException If document could not be parsed.
     */
    public static WSDLModel getWsdlModel(URL resourceUrl, boolean isClient)
            throws IOException, XMLStreamException, SAXException {
        final SDDocumentSource doc = SDDocumentSource.create(resourceUrl);
        final Parser parser = new Parser(doc);
        final WSDLModel model = WSDLModel.WSDLParser.parse(parser,
                                                           new PolicyEntityResolver(),
                                                           isClient,
                                                           Container.NONE,
                                                           PolicyResolverFactory.DEFAULT_POLICY_RESOLVER,
View Full Code Here

         */
        public Parser resolveEntity(final String publicId, final String systemId)
            throws XMLStreamException, IOException {

            LOGGER.entering(publicId, systemId);
            Parser parser = null;

            try {
                // TODO: think about using alg from http://www.w3.org/International/O-URL-code.html
                final URL systemUrl = new URL(PolicyUtils.Rfc2396.unquote(systemId));
                final InputStream input = systemUrl.openStream();
                final XMLStreamReader reader = new TidyXMLStreamReader(xmlInputFactory.createXMLStreamReader(systemId, input), input);

                parser = new Parser(systemUrl, reader);
                return parser;
            } finally {
                LOGGER.exiting(parser);
            }
        }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.api.wsdl.parser.XMLEntityResolver.Parser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.