Examples of WSDLFactory


Examples of javax.wsdl.factory.WSDLFactory

        assertNotNull(mockPort);
    }

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

Examples of javax.wsdl.factory.WSDLFactory

        assertNotNull(bookQuote);
    }

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

Examples of javax.wsdl.factory.WSDLFactory

            System.out.println("Skipping external ws test");
        }
    }

    public void testBuildComplexTypeMap() throws Exception {
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        Definition definition = reader.readWSDL(wsdlFile.toURI().toString());
        SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(null, definition);
        Map complexTypeMap = schemaInfoBuilder.getComplexTypesInWsdl();
        assertEquals(7, complexTypeMap.size());
    }
View Full Code Here

Examples of javax.wsdl.factory.WSDLFactory


    private OperationInfo buildOperationInfoForMockOperation(AxisBuilder builder) throws NoSuchMethodException, DeploymentException, WSDLException {
        Class portClass = MockPort.class;
        Method method = portClass.getDeclaredMethod("doMockOperation", new Class[]{String.class});
        WSDLFactory factory = WSDLFactory.newInstance();
        Definition definition = factory.newDefinition();
        ExtensionRegistry extensionRegistry = factory.newPopulatedExtensionRegistry();
        BindingOperation bindingOperation = buildBindingOperation(definition, extensionRegistry);

        Style defaultStyle = Style.DOCUMENT;

        OperationInfo operationInfo = builder.buildOperationInfoLightweight(method, bindingOperation, defaultStyle, SOAPConstants.SOAP11_CONSTANTS);
View Full Code Here

Examples of javax.wsdl.factory.WSDLFactory

        OperationInfo operationInfo = builder.buildOperationInfoLightweight(method, bindingOperation, defaultStyle, SOAPConstants.SOAP11_CONSTANTS);
        return operationInfo;
    }

    private Definition buildDefinition() throws WSDLException {
        WSDLFactory factory = WSDLFactory.newInstance();
        Definition definition = factory.newDefinition();
        definition.setDocumentBaseURI("META-INF/wsdl/fake.wsdl");
        ExtensionRegistry extensionRegistry = factory.newPopulatedExtensionRegistry();
        BindingOperation bindingOperation = buildBindingOperation(definition, extensionRegistry);
        Binding binding = definition.createBinding();
        binding.setQName(new QName(NAMESPACE, "MockPortBinding"));
        //add soap:binding
        SOAPBinding soapBinding = (SOAPBinding) extensionRegistry.createExtension(Binding.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"));
View Full Code Here

Examples of javax.wsdl.factory.WSDLFactory

    }


    public Definition readWsdl(JarFile moduleFile, URI wsdlURI) throws DeploymentException {
        Definition definition;
        WSDLFactory wsdlFactory = null;
        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 {
View Full Code Here

Examples of javax.wsdl.factory.WSDLFactory

                throw new Exception("Invalid request: " + baseUri);
            }
        }

        if (!mp.containsKey(wsdl)) {
            WSDLFactory factory = WSDLFactory.newInstance();
            WSDLReader reader = factory.newWSDLReader();
            reader.setFeature("javax.wsdl.importDocuments", true);
            reader.setFeature("javax.wsdl.verbose", false);
            Definition def = reader.readWSDL(wsdlUri);
            updateDefinition(def, mp, smp, base);
            // remove other services and ports from wsdl
            WSDLUtils.trimDefinition(def, this.service.getName(), this.service.getEndpointName());
            mp.put("", def);
        }

        Element rootElement;

        if (xsd == null) {
            Definition def = mp.get(wsdl);

            if (def == null) {
                throw new FileNotFoundException("WSDL not found: " + wsdl);
            }
           
            // update service port location on each request
            if (wsdl.equals("")) {
                WSDLUtils.updateLocations(def, base);
            }
           
            WSDLFactory factory = WSDLFactory.newInstance();
            WSDLWriter writer = factory.newWSDLWriter();

            rootElement = writer.getDocument(def).getDocumentElement();
        } else {
            SchemaReference si = smp.get(xsd);
           
View Full Code Here

Examples of javax.wsdl.factory.WSDLFactory

                wsdlStream = wsdlURL.openStream();
                if(wsdlStream == null){
                    throw new IOException("unable to read descriptor " + wsdlURL);
                }
                else {
                    WSDLFactory factory = WSDLFactory.newInstance();
                    WSDLReader reader = factory.newWSDLReader();
                    reader.setFeature("javax.wsdl.importDocuments", true);
                    reader.setFeature("javax.wsdl.verbose", false);
                    wsdlDefinition = reader.readWSDL(wsdlURL.toString());
                    wsdlStream.close();                  
                }
View Full Code Here

Examples of javax.wsdl.factory.WSDLFactory

                        log.info("Unable to call updateServices ["+ qName + "][" + portName +"]");                       
                    } else {
                        log.info("calling updateServices ["+ qName + "][" + portName +"]");                       
                        updateServices(qName, portName, wsdlDefinition, request);
                    }
                    WSDLFactory factory = WSDLFactory.newInstance();
                    WSDLWriter writer = factory.newWSDLWriter();                   
                    writer.writeWSDL(wsdlDefinition, response.getOutputStream());
                    return;
                }
            }else {
                service.printWSDL(response.getOutputStream());
View Full Code Here

Examples of javax.wsdl.factory.WSDLFactory

            // not a URL, assume it's a local reference
            wsdlLocator = new JarWSDLLocator(this.wsdlURI);
        }

        Definition definition;
        WSDLFactory wsdlFactory;
        try {
            wsdlFactory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            throw new DeploymentException("Could not create WSDLFactory", e);
        }
        WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
        wsdlReader.setFeature("javax.wsdl.importDocuments", true);
        wsdlReader.setFeature("javax.wsdl.verbose", false);
        try {
            if (wsdlURL != null) {
                definition = wsdlReader.readWSDL(wsdlURL.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.