Package org.apache.tuscany.sca.interfacedef.wsdl

Examples of org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract


    public WSDLInterfaceContract read(XMLStreamReader reader) throws ContributionReadException {
        try {
   
            // Read an <interface.wsdl>
            WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
           
            // Read wsdlLocation
            String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
            wsdlInterfaceContract.setLocation(location);
           
            String uri = reader.getAttributeValue(null, INTERFACE);
            if (uri != null) {
                WSDLInterface wsdlInterface = createWSDLInterface(uri);
                wsdlInterfaceContract.setInterface(wsdlInterface);
            }
           
            uri = reader.getAttributeValue(null, CALLBACK_INTERFACE);
            if (uri != null) {
                WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri);
                wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
            }
               
            // Skip to end element
            while (reader.hasNext()) {
                if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) {
View Full Code Here


     */
    private Reference generateReference( String name, PortType myRolePT,
        PortType partnerRolePT, Collection<WSDLInterface> theInterfaces  )
        throws ContributionResolveException {
        Reference reference = assemblyFactory.createReference();
        WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
        reference.setInterfaceContract(interfaceContract);
       
        // Establish whether there is just a call interface or a call + callback interface
        PortType callPT = null;
        PortType callbackPT = null;
View Full Code Here

     */
    private Service generateService( String name, PortType myRolePT,
        PortType partnerRolePT, Collection<WSDLInterface> theInterfaces )
        throws ContributionResolveException {
        Service service = assemblyFactory.createService();
        WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
        service.setInterfaceContract(interfaceContract);
       
        // Set the name of the service to the supplied name
        service.setName(name);
       
View Full Code Here

        DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint();
        JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null);
        new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface);
        new DataBindingJavaInterfaceProcessor(dataBindings).visitInterface(iface);
        javaIC.setInterface(iface);
        WSDLInterfaceContract wsdlIC = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, null);
        assertNotNull(wsdlIC);
        WSDLInterface wsdlInterface = (WSDLInterface)wsdlIC.getInterface();
        assertNotNull(wsdlInterface);
        assertEquals(1, wsdlInterface.getOperations().size());
        assertEquals("sayHello", wsdlInterface.getOperations().get(0).getName());
        assertNotNull(wsdlInterface.getPortType());
        JavaInterfaceContract javaIC2 = factory.createJavaInterfaceContract();
        JavaInterface iface2 = factory.createJavaInterface(TestJavaInterface.class);
        new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface2);
        new DataBindingJavaInterfaceProcessor(dataBindings).visitInterface(iface2);
        javaIC2.setInterface(iface2);
        WSDLInterfaceContract wsdlIC2 = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC2, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, null);
        assertNotNull(wsdlIC2);
    }
View Full Code Here

                }
            }

            PortType portType = getPortType(model);
            if (portType != null) {
                WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
                WSDLInterface wsdlInterface = null;
                try {
                    wsdlInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver);
                } catch (InvalidInterfaceException e) {
                  warning("InvalidInterfaceException", wsdlFactory, model.getName());
                }
                interfaceContract.setInterface(wsdlInterface);
                model.setBindingInterfaceContract(interfaceContract);
            }
        }
        policyProcessor.resolvePolicies(model, resolver);
        OperationsConfigurator opCongigurator = (OperationsConfigurator)model;
View Full Code Here

                                                                       DataBindingExtensionPoint dataBindings,
                                                                       WSDLFactory wsdlFactory,
                                                                       XSDFactory xsdFactory,
                                                                       Monitor monitor) {

        WSDLInterfaceContract wsdlContract = wsdlFactory.createWSDLInterfaceContract();
        WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface();
        wsdlContract.setInterface(wsdlInterface);

        WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
        JavaInterface iface = (JavaInterface)contract.getInterface();

        Definition def = null;
View Full Code Here

        return wsdlInterface;
    }

    public WSDLInterfaceContract read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
        // Read an <interface.wsdl>
        WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
       
        // Read wsdlLocation
        String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
        wsdlInterfaceContract.setLocation(location);
       
        String uri = reader.getAttributeValue(null, INTERFACE);
        if (uri != null) {
            WSDLInterface wsdlInterface = createWSDLInterface(uri);
            if (wsdlInterface != null)
                wsdlInterfaceContract.setInterface(wsdlInterface);
        }
       
        uri = reader.getAttributeValue(null, CALLBACK_INTERFACE);
        if (uri != null) {
            WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri);
            if (wsdlCallbackInterface != null)
                wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
        }
           
        // Skip to end element
        while (reader.hasNext()) {
            if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) {
View Full Code Here

    public void testCreateWSDLInterfaceContract() throws InvalidInterfaceException {
        DefaultJavaInterfaceFactory factory = new DefaultJavaInterfaceFactory();
        JavaInterfaceContract javaIC = factory.createJavaInterfaceContract();
        javaIC.setInterface(factory.createJavaInterface(HelloWorld.class));
        WSDLInterfaceContract wsdlIC = Java2WSDLHelper.createWSDLInterfaceContract(javaIC);
        assertNotNull(wsdlIC);
        WSDLInterface wsdlInterface = (WSDLInterface)wsdlIC.getInterface();
        assertNotNull(wsdlInterface);
        assertEquals(1, wsdlInterface.getOperations().size());
        assertEquals("sayHello", wsdlInterface.getOperations().get(0).getName());
        assertNotNull(wsdlInterface.getPortType());
    }
View Full Code Here

        JavaInterface iface = (JavaInterface)contract.getInterface();
        Definition def = Java2WSDLHelper.createDefinition(iface.getJavaClass());

        DefaultWSDLFactory wsdlFactory = new DefaultWSDLFactory();

        WSDLInterfaceContract wsdlContract = wsdlFactory.createWSDLInterfaceContract();
        WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface();

        wsdlContract.setInterface(wsdlInterface);
        WSDLDefinition wsdlDefinition = new DefaultWSDLFactory().createWSDLDefinition();
        wsdlDefinition.setDefinition(def);
        wsdlInterface.setWsdlDefinition(wsdlDefinition);
        wsdlInterface.setRemotable(true);
        wsdlInterface.setConversational(contract.getInterface().isConversational());
View Full Code Here

    public WSDLInterfaceContract read(XMLStreamReader reader) throws ContributionReadException {
        try {
   
            // Read an <interface.wsdl>
            WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
           
            // Read wsdlLocation
            String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
            wsdlInterfaceContract.setLocation(location);
           
            String uri = reader.getAttributeValue(null, INTERFACE);
            if (uri != null) {
                WSDLInterface wsdlInterface = createWSDLInterface(uri);
                wsdlInterfaceContract.setInterface(wsdlInterface);
            }
           
            uri = reader.getAttributeValue(null, CALLBACK_INTERFACE);
            if (uri != null) {
                WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri);
                wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
            }
               
            // Skip to end element
            while (reader.hasNext()) {
                if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract

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.