Examples of WSDLServiceContract


Examples of org.apache.tuscany.idl.wsdl.WSDLServiceContract

        } else {
            portType = getPortType(wsdlNamespace, wsdlPortType);
        }

        ServiceDefinition service = new ServiceDefinition();
        WSDLServiceContract wsdlSC = new WSDLServiceContract();
        wsdlSC.setPortType(portType);
        service.setServiceContract(wsdlSC);
        componentType.add(service);
    }
View Full Code Here

Examples of org.apache.tuscany.idl.wsdl.WSDLServiceContract

        } else {
            portType = getPortType(wsdlNamespace, wsdlPortType);
        }

        ServiceDefinition service = new ServiceDefinition();
        WSDLServiceContract wsdlSC = new WSDLServiceContract();
        wsdlSC.setPortType(portType);
        service.setServiceContract(wsdlSC);
        componentType.add(service);
    }
View Full Code Here

Examples of org.apache.tuscany.idl.wsdl.WSDLServiceContract

        ServiceDefinition serviceDefinition = (ServiceDefinition) services.values()
                                                                          .iterator()
                                                                          .next();
        ServiceContract serviceContract = serviceDefinition.getServiceContract();
        assertTrue(serviceContract instanceof WSDLServiceContract);
        WSDLServiceContract wsdlServiceContract = (WSDLServiceContract) serviceContract;
        assertEquals(new QName("http://helloworld", "HelloWorld"),
                     wsdlServiceContract.getPortType().getQName());
    }
View Full Code Here

Examples of org.apache.tuscany.idl.wsdl.WSDLServiceContract

        //Create a mocked WireService, make the call of ServiceExtension.getServiceInstance() returns a proxy instance.
        WireService wireService = EasyMock.createNiceMock(WireService.class);
        EasyMock.replay(wireService);
        CompositeComponent parent = EasyMock.createNiceMock(CompositeComponent.class);
        // TODO figure out what to do with the service contract
        ServiceContract<?> contract = new WSDLServiceContract();
        contract.setInterfaceClass(Greeter.class);
        WorkContext workContext = EasyMock.createNiceMock(WorkContext.class);
        EasyMock.replay(workContext);
        return new Axis2Reference(serviceName,
                parent,
                wireService,
View Full Code Here

Examples of org.apache.tuscany.idl.wsdl.WSDLServiceContract

        Map services = comonentType.getServices();
        assertEquals(1, services.size());
        ServiceDefinition serviceDefinition = (ServiceDefinition) services.values().iterator().next();
        ServiceContract serviceContract = serviceDefinition.getServiceContract();
        assertTrue(serviceContract instanceof WSDLServiceContract);
        WSDLServiceContract wsdlServiceContract = (WSDLServiceContract) serviceContract;
        assertEquals(new QName("http://helloworld", "HelloWorld"), wsdlServiceContract.getPortType().getQName());
    }
View Full Code Here

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

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

    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

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

    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

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

        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

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

    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
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.