Package org.apache.tuscany.model.types.wsdl

Examples of org.apache.tuscany.model.types.wsdl.WSDLServiceContract


        return AssemblyConstants.INTERFACE_WSDL;
    }

    public WSDLServiceContract load(XMLStreamReader reader, LoaderContext loaderContext) throws XMLStreamException, ConfigurationLoadException {
        assert AssemblyConstants.INTERFACE_WSDL.equals(reader.getName());
        WSDLServiceContract serviceContract = factory.createWSDLServiceContract();
        serviceContract.setScope(Scope.INSTANCE);
       
        ResourceLoader resourceLoader = loaderContext.getResourceLoader();

        String location = reader.getAttributeValue(WSDLI, WSDLI_LOCATION);
        if (location != null) {
            try {
                wsdlRegistry.loadDefinition(location, resourceLoader);
            } catch (IOException e) {
                throw new MissingInterfaceException(e);
            } catch (WSDLException e) {
                throw new MissingInterfaceException(e);
            }
        }

        String portTypeURI = reader.getAttributeValue(null, "interface");
        if (portTypeURI != null) {
            serviceContract.setPortType(getPortType(portTypeURI, resourceLoader));
        }

        portTypeURI = reader.getAttributeValue(null, "callbackInterface");
        if (portTypeURI != null) {
            serviceContract.setCallbackPortType(getPortType(portTypeURI, resourceLoader));
        }
        StAXUtil.skipToEndElement(reader);
        return serviceContract;
    }
View Full Code Here


    private ResourceLoader resourceLoader;

    public void testMinimal() throws XMLStreamException, ConfigurationLoadException {
        String xml = "<interface.wsdl xmlns='http://www.osoa.org/xmlns/sca/0.9'></interface.wsdl>";
        XMLStreamReader reader = getReader(xml);
        WSDLServiceContract sc = (WSDLServiceContract) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, INTERFACE_WSDL.getNamespaceURI(), INTERFACE_WSDL.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(sc);
    }
View Full Code Here

    public void testInterface() throws Exception {
        wsdlRegistry.loadDefinition("http://www.example.org", getClass().getResource("example.wsdl"), resourceLoader);
        String xml = "<interface.wsdl xmlns='http://www.osoa.org/xmlns/sca/0.9' interface='http://www.example.org#HelloWorld'></interface.wsdl>";
        XMLStreamReader reader = getReader(xml);
        WSDLServiceContract sc = (WSDLServiceContract) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, INTERFACE_WSDL.getNamespaceURI(), INTERFACE_WSDL.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(sc);
    }
View Full Code Here

        String xml = "<interface.wsdl xmlns='http://www.osoa.org/xmlns/sca/0.9' xmlns:wsdli='http://www.w3.org/2006/01/wsdl-instance' " +
                "wsdli:wsdlLocation='http://www.example.org " + getClass().getResource("example.wsdl") + "' "+
                "interface='http://www.example.org#HelloWorld'"+
                "></interface.wsdl>";
        XMLStreamReader reader = getReader(xml);
        WSDLServiceContract sc = (WSDLServiceContract) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, INTERFACE_WSDL.getNamespaceURI(), INTERFACE_WSDL.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(sc);
    }
View Full Code Here

    public void testInterface() throws Exception {
        wsdlRegistry.loadDefinition("http://www.interfacestyles.org", getClass().getResource("interfacestyles.wsdl"), resourceLoader);
        String xml = "<interface.wsdl xmlns='http://www.osoa.org/xmlns/sca/0.9' interface='http://www.interfacestyles.org#TestInterfaceStylesService'></interface.wsdl>";
        XMLStreamReader reader = getReader(xml);
        WSDLServiceContract sc = (WSDLServiceContract) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, INTERFACE_WSDL.getNamespaceURI(), INTERFACE_WSDL.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(sc);
       
        sc.initialize(modelContext);
       
        Class scInterface = sc.getInterface();
        assertNotNull(scInterface);
       
        assertNotNull(scInterface.getMethod("getAccountReportWrapped0", new Class[0]));
        assertNotNull(scInterface.getMethod("getAccountReportWrapped1", new Class[] {String.class}));
        assertNotNull(scInterface.getMethod("getAccountReportWrappedN", new Class[] {String.class, int.class}));
View Full Code Here

TOP

Related Classes of org.apache.tuscany.model.types.wsdl.WSDLServiceContract

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.