Package javax.wsdl.xml

Examples of javax.wsdl.xml.WSDLReader


        URL url = new URL(baseURL + warName + "?wsdl");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        try {
            conn.setUseCaches(false);

            WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
            Definition def =
                wsdlReader.readWSDL(null, new InputSource(conn.getInputStream()));

            System.out.println("WSDL: " + def);

            assertTrue(def.getPortTypes().size() > 0);
View Full Code Here


        synchronized (definitionsMap) {
            if (definitionsMap.containsKey(el)) {
                return definitionsMap.get(el);
            }
        }
        WSDLReader reader = factory.newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", false);
        reader.setExtensionRegistry(registry);      
        Definition def = reader.readWSDL("", el);
        synchronized (definitionsMap) {
            definitionsMap.put(el, def);
        }
        return def;
    }
View Full Code Here

            definitionsMap.put(key, wsdl);
        }
    }

    protected Definition loadDefinition(String url) throws WSDLException {
        WSDLReader reader = factory.newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", false);
        reader.setFeature("javax.wsdl.importDocuments", true);
        reader.setExtensionRegistry(registry);
        CatalogWSDLLocator catLocator = new CatalogWSDLLocator(url, bus);
        ResourceManagerWSDLLocator wsdlLocator = new ResourceManagerWSDLLocator(url,
                                                                                catLocator,
                                                                                bus);
        InputSource src = wsdlLocator.getBaseInputSource();
        Definition def = null;
        if (src.getByteStream() != null || src.getCharacterStream() != null) {
            Document doc;
            XMLStreamReader xmlReader = null;
            try {
                xmlReader = StaxUtils.createXMLStreamReader(src);
                if (xmlStreamReaderWrapper != null) {
                    xmlReader = xmlStreamReaderWrapper.wrap(xmlReader);
                }
                doc = StaxUtils.read(xmlReader, true);
                if (src.getSystemId() != null) {
                    try {
                        doc.setDocumentURI(new String(src.getSystemId()));
                    } catch (Exception e) {
                        //ignore - probably not DOM level 3
                    }
                }
            } catch (Exception e) {
                throw new WSDLException(WSDLException.PARSER_ERROR, e.getMessage(), e);
            } finally {
                try {
                    StaxUtils.close(xmlReader);
                } catch (XMLStreamException ex) {
                    throw new WSDLException(WSDLException.PARSER_ERROR, ex.getMessage(), ex);
                }
            }
            def = reader.readWSDL(wsdlLocator, doc.getDocumentElement());
        } else {
            def = reader.readWSDL(wsdlLocator);
        }
       
        return def;
    }
View Full Code Here

        return null;
    }

    public Definition getDefinition(File wsdlFile) throws Exception {
        WSDLFactory wsdlFactory = WSDLFactory.newInstance();
        WSDLReader reader = wsdlFactory.newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", false);
        return reader.readWSDL(wsdlFile.toURI().toURL().toString());
    }
View Full Code Here

     * @param doc doc This is the XML Document containing the WSDL.
     */
    public void populate(String context, Document doc)
        throws IOException, SAXException, WSDLException,
               ParserConfigurationException {
        WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", verbose);
        this.def = reader.readWSDL(context, doc);

        add(context, def, doc);
    } // populate
View Full Code Here

        return ret.booleanValue();
    }

    private static WSDLReader getWSDLReader() throws WSDLException {
        // Keep this method private
        WSDLReader reader;
        try {
            reader = (WSDLReader)AccessController.doPrivileged(
                    new PrivilegedExceptionAction() {
                        public Object run() throws WSDLException {
                            WSDLFactory factory = WSDLFactory.newInstance();
View Full Code Here

                                log.debug("Loading WSDL using ModuleWSDLLocator from base " +
                                        "location: " + wsdlExplicitURL);
                            }
                            def = (Definition) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                                public Object run() throws WSDLException {
                                    WSDLReader reader = getWSDLReader();
                                    return reader.readWSDL(locator);
                                }
                            });
                        }
                    }
                    catch(Exception e) {
                        if(log.isDebugEnabled()) {
                            log.debug("Using ModuleWSDLLocator was not successful for loading " +
                                    "WSDL due to the following error: " + e.toString() + ". The " +
                                    "WSDL will be read from the WSDL location: " + wsdlExplicitURL);
                        }
                    }
                }
                if(def == null) {
                    if(log.isDebugEnabled()) {
                        log.debug("Loading WSDL from location: " + wsdlExplicitURL);
                    }
                    def = (Definition) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                        public Object run() throws WSDLException {
                            WSDLReader reader = getWSDLReader();
                            return reader.readWSDL(wsdlExplicitURL);
                        }
                    });
                }
               
            } catch (PrivilegedActionException e) {
View Full Code Here

        while((line = br.readLine()) != null) {
            System.out.println(line);
        }
        br.close();

        WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
        wsdlReader.setFeature("javax.wsdl.verbose", false);
        wsdlReader.setFeature("javax.wsdl.importDocuments", true);

        Definition definition = wsdlReader.readWSDL("http://localhost:8085/AccountService?wsdl");
        assertNotNull(definition);
        Service service = definition.getService(new QName("http://accounts/AccountService/$promoted$.ep1", "AccountService"));
        Port port = service.getPort("AccountSoapPort");

        String endpoint = getEndpoint(port);
View Full Code Here

        while((line = br.readLine()) != null) {
            System.out.println(line);
        }
        br.close();

        WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
        wsdlReader.setFeature("javax.wsdl.verbose",false);
        wsdlReader.setFeature("javax.wsdl.importDocuments",true);

        Definition definition = wsdlReader.readWSDL("http://localhost:8085/services/HelloWorldWebService?wsdl");
        assertNotNull(definition);
        Service service = definition.getService(new QName("http://helloworld/HelloWorldService/$promoted$.ep1",
                                                          "HelloWorldService"));
        Port port = service.getPort("HelloWorldSoapPort");
View Full Code Here

        while((line = br.readLine()) != null) {
            System.out.println(line);
        }
        br.close();

        WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
        wsdlReader.setFeature("javax.wsdl.verbose",false);
        wsdlReader.setFeature("javax.wsdl.importDocuments",true);

        Definition definition = wsdlReader.readWSDL("http://localhost:8085/foo/bar?wsdl");
        assertNotNull(definition);
        Service service = definition.getService(new QName("http://itests.axis2.ws.binding.sca.tuscany.apache.org/",
                                                          "HelloWorldService"));
        Port port = service.getPort("HelloWorldPort");
View Full Code Here

TOP

Related Classes of javax.wsdl.xml.WSDLReader

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.