Package com.sun.xml.internal.ws.wsdl.writer

Examples of com.sun.xml.internal.ws.wsdl.writer.WSDLPatcher


    }

    private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {

        DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
        WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
            @Override
            public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
                return null;
            }
        }, docLocator);

        //XMLInputFactory readerFactory = XMLInputFactory.newInstance();
        //XMLStreamReader xsr = readerFactory.createXMLStreamReader(new DOMSource(forest.get(rootWsdl)));

        XMLStreamReader xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
        XMLOutputFactory writerfactory = XMLOutputFactory.newInstance();
        String resolvedRootWsdl = docLocator.getLocationFor(null, doc);
        File outFile = new File(destDir, resolvedRootWsdl);
        OutputStream os = new FileOutputStream(outFile);
        if(options.verbose) {
            listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
        }
        XMLStreamWriter xsw = writerfactory.createXMLStreamWriter(os);
        //DOMForest eats away the whitespace loosing all the indentation, so write it through
        // indenting writer for better readability of fetched documents
        IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
        wsdlPatcher.bridge(xsr, indentingWriter);
        xsr.close();
        xsw.close();
        os.close();
        options.addGeneratedFile(outFile);
        return resolvedRootWsdl;
View Full Code Here


        }

        XMLStreamReader xsr = source.read();
        try {
            out.writeComment(VERSION_COMMENT);
            new WSDLPatcher(portAddressResolver, new DocumentLocationResolverImpl(resolver)).bridge(xsr,out);
        } finally {
            xsr.close();
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.internal.ws.wsdl.writer.WSDLPatcher

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.