Package javax.wsdl.xml

Examples of javax.wsdl.xml.WSDLReader


        URL url = getClass().getResource("/wsdl/doc_lit_bare.wsdl");
        assertNotNull("Could not find wsdl /wsdl/doc_lit_bare.wsdl", url);
       
       
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", false);
        InputSource input = new InputSource(url.openStream());
        Definition def = reader.readWSDL(null, input);
        Port port = def.getService(new QName("http://objectweb.org/hello_world_doc_lit_bare",
                                             "SOAPService")).getPort("SoapPort");
        WSDLMetaDataCache wsdl = new WSDLMetaDataCache(def, port);
       
        for (Method method : cls.getDeclaredMethods()) {
View Full Code Here


        public Definition getDefinition(String url) throws WSDLException {
            return loadDefinition(url);
        }

        public Definition getDefinition(Element element) throws WSDLException {
            WSDLReader reader = factory.newWSDLReader();
            reader.setFeature("javax.wsdl.verbose", false);
            reader.setExtensionRegistry(getExtenstionRegistry());
            return reader.readWSDL(null, element);
        }
View Full Code Here

        public Definition getDefinition(Class<?> sei) throws WSDLException {
            // TODO Auto-generated method stub
            return null;
        }
        private Definition loadDefinition(String url) throws WSDLException {
            WSDLReader reader = factory.newWSDLReader();
            reader.setFeature("javax.wsdl.verbose", false);
            reader.setExtensionRegistry(getExtenstionRegistry());
            return reader.readWSDL(url);
        }
View Full Code Here

  }

  public  List getWsdlPortTypeByUri( String wsdlURI ){

    WSDLFactory fact;
    WSDLReader read;
    Definition def;
    Map map;

    String dir = this.getAppPath(this.getClass());
    dir = dir.replace('/', File.separatorChar);
    dir = dir.substring(0, dir.lastIndexOf(File.separator));
    dir = dir.substring(0, dir.lastIndexOf(File.separator));

    wsdlURI = dir + File.separator + wsdlURI;
    wsdlURI = wsdlURI.replace('\\', File.separatorChar);
    try {
      fact = WSDLFactory.newInstance();
      read = fact.newWSDLReader();
      def = read.readWSDL(wsdlURI);
      map = def.getPortTypes();

      PortType p = new PortTypeImpl() ;
      QName qname = p.getQName();
      //Operation op = p.getOperation(wsdlURI, wsdlURI, wsdlURI);
View Full Code Here


  public  List getWsdlPortTypeBycaracterStream( Reader caracterStream ){

    WSDLFactory fact;
    WSDLReader read;
    Definition def;
    Map map;

    try {
      fact = WSDLFactory.newInstance();
      read = fact.newWSDLReader();
      def = read.readWSDL(null,new InputSource(caracterStream));
      map = def.getPortTypes();

      wsdl.PortTypeImplm portType;
      wsdl.OperationImplm operation;
      List<wsdl.PortTypeImplm> portTypeList = new ArrayList<wsdl.PortTypeImplm>();
View Full Code Here

        AxisService axisService = proxyService.buildAxisService(synCfg, axisCfg);
        // Serialize the WSDL
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        axisService.printWSDL(baos);
        // Check that the produced WSDL can be read by WSDL4J
        WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
        wsdlReader.readWSDL(null, new InputSource(new ByteArrayInputStream(baos.toByteArray())));
    }
View Full Code Here

            } catch (IOException e) {
                handleException(WSDLException.INVALID_WSDL + "IO Error", e);
            }
            if (doc != null) {
                WSDLFactory fac = WSDLFactory.newInstance();
                WSDLReader reader = fac.newWSDLReader();
                Definition definition = reader.readWSDL(wsdlLocator, doc.getDocumentElement());
                return createEndpointDefinitionFromWSDL(definition, service, port);
            }
        } catch (XMLStreamException e) {
            handleException("Error retrieving the WSDL definition from the inline WSDL.", e);
        } catch (WSDLException e) {
View Full Code Here

        try {
            wsdlFactory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            throw new DeploymentException("Could not create WSDLFactory", e);
        }
        WSDLReader wsdlReaderNoImport = wsdlFactory.newWSDLReader();
        wsdlReaderNoImport.setFeature("javax.wsdl.importDocuments", false);
        ExtensionRegistry extensionRegistry = new PopulatedExtensionRegistry();
        extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
                UnknownExtensibilityElement.class);
        extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
                extensionRegistry.getDefaultDeserializer());
        extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
                extensionRegistry.getDefaultSerializer());

        extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
                UnknownExtensibilityElement.class);
        extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
                extensionRegistry.getDefaultDeserializer());
        extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
                extensionRegistry.getDefaultSerializer());

        extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
                UnknownExtensibilityElement.class);
        extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
                extensionRegistry.getDefaultDeserializer());
        extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
                extensionRegistry.getDefaultSerializer());
        wsdlReaderNoImport.setExtensionRegistry(extensionRegistry);

        JarWSDLLocator wsdlLocator = new JarWSDLLocator(wsdlURI);
        WSDLReader wsdlReader = wsdlFactory.newWSDLReader();

        Thread thread = Thread.currentThread();
        ClassLoader oldCl = thread.getContextClassLoader();
        thread.setContextClassLoader(this.getClass().getClassLoader());
        try {
            try {
                definition = wsdlReader.readWSDL(wsdlLocator);
            } catch (WSDLException e) {
                throw new DeploymentException("Failed to read wsdl document", e);
            } catch (RuntimeException e) {
                throw new DeploymentException(e.getMessage(), e);
            }
View Full Code Here

    }

    public void testBuildBookQuoteProxy() throws Exception {
        File wsdl = new File(BASEDIR, "src/test/resources/BookQuote.wsdl");
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        Definition definition = reader.readWSDL(wsdl.toURI().toString());
        SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(null, definition);
        File jaxrpcMapping = new File(BASEDIR, "src/test/resources/BookQuote.xml");
        JavaWsdlMappingDocument mappingDocument = JavaWsdlMappingDocument.Factory.parse(jaxrpcMapping);
        JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
        QName serviceQName = new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote", "BookQuoteService");
View Full Code Here

    }

    //needs to have heavyweight mapping
    public void xtestBuildInteropProxy() throws Exception {
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        Definition definition = reader.readWSDL(wsdlFile.toURI().toString());
        SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(null, definition);
        File jaxrpcMapping = new File(BASEDIR, "src/test/resources/interop/interop-jaxrpcmapping.xml");
        JavaWsdlMappingDocument mappingDocument = JavaWsdlMappingDocument.Factory.parse(jaxrpcMapping);
        JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
        QName serviceQName = new QName("http://tempuri.org/4s4c/1/3/wsdl/def/interopLab", "interopLab");
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.