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

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


                wsdlFileName.length() > 0){        
            WSDLInterface callInterface = wsdlFactory.createWSDLInterface();
            callInterface.setUnresolved(true);
            callInterface.setRemotable(true);
           
            WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
            wsdlInterfaceContract.setInterface(callInterface);
            wsdlInterfaceContract.setLocation(wsdlFileName);
            javaInterfaceContract.setNormalizedWSDLContract(wsdlInterfaceContract);
       
       
        // add the service model into the implementation type
        Service serviceAlreadyPresent = null;
View Full Code Here


                                                                    WSDLFactory wsdlFactory,
                                                                    XSDFactory xsdFactory,
                                                                    DocumentBuilderFactory documentBuilderFactory,
                                                                    Monitor monitor) {

        WSDLInterfaceContract wsdlContract = wsdlFactory.createWSDLInterfaceContract();
       
        if (contract.getInterface() != null){
            WSDLInterface wsdlInterface = createWSDLInterface((JavaInterface)contract.getInterface(),
                                                               requiresSOAP12,
                                                               resolver,
                                                               dataBindings,
                                                               wsdlFactory,
                                                               xsdFactory,
                                                               documentBuilderFactory,
                                                               monitor);
            wsdlContract.setInterface(wsdlInterface);
        }
       
        if (contract.getCallbackInterface() != null){
            WSDLInterface wsdlInterface = createWSDLInterface((JavaInterface)contract.getCallbackInterface(),
                    requiresSOAP12,
                    resolver,
                    dataBindings,
                    wsdlFactory,
                    xsdFactory,
                    documentBuilderFactory,
                    monitor);
            wsdlContract.setCallbackInterface(wsdlInterface);
        }

        return wsdlContract;
    }
View Full Code Here

        }
// Uncomment the printWSDL =  lines to see the WSDL that is generated
// for interface matching purposes
//        BindingWSDLGenerator.printWSDL = true;
        JavaInterfaceContract javaContract = (JavaInterfaceContract)interfaceContract;       
        WSDLInterfaceContract wsdlContract =
            BindingWSDLGenerator.createWSDLInterfaceContract(javaContract,
                                                             false,
                                                             null,
                                                             dataBindings,
                                                             wsdlFactory,
View Full Code Here

        DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint(registry);
        JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null);
        new JAXWSJavaInterfaceProcessor(registry).visitInterface(iface);
        new DataBindingJavaInterfaceProcessor(registry).visitInterface(iface);
        javaIC.setInterface(iface);
        WSDLInterfaceContract wsdlIC = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, documentBuilderFactory, 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(registry).visitInterface(iface2);
        new DataBindingJavaInterfaceProcessor(registry).visitInterface(iface2);
        javaIC2.setInterface(iface2);
        BindingWSDLGenerator.printWSDL = true;
        WSDLInterfaceContract wsdlIC2 = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC2, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, documentBuilderFactory, null);
        assertNotNull(wsdlIC2);
    }
View Full Code Here

     * @param reader - XMLStreamReader holding the <interface.wsdl/> element
     * @return - the WSDLInterfaceContract
     */
    public WSDLInterfaceContract read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
        // Read an <interface.wsdl>
        WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
        Monitor monitor = context.getMonitor();
       
        // Read wsdlLocation
        String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
        wsdlInterfaceContract.setLocation(location);
       
        String uri = getURIString(reader, INTERFACE);
        if (uri != null) {
            WSDLInterface wsdlInterface = createWSDLInterface(uri, monitor);
            if (wsdlInterface != null)
                wsdlInterfaceContract.setInterface(wsdlInterface);
        }
       
        uri = getURIString(reader, CALLBACK_INTERFACE);
        if (uri != null) {
            WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri, monitor);
            if (wsdlCallbackInterface != null)
                wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
        }
       
        String remotable = reader.getAttributeValue(null, REMOTABLE);
        if (remotable != null &&
            !remotable.equals("true")){
            Monitor.error(monitor,
                          this,
                          "interface-wsdlxml-validation-messages",
                          "InvalidRemotableValue",
                          ((WSDLInterface)wsdlInterfaceContract.getInterface()).getName().toString(),
                          remotable);
        }
       
        // Read intents and policy sets
        policyProcessor.readPolicies(wsdlInterfaceContract.getInterface(), reader);
           
        // Skip to end element
        while (reader.hasNext()) {
            if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) {
                break;
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, context.getMonitor());
                    // save the wsdlDefinition that was used to generate the interface
                    wsdlInterface.setWsdlDefinition(wsdlDefinition);
                    interfaceContract.setInterface(wsdlInterface);
                    interfaceContract.setCallbackInterface(wsdlInterface.getCallbackInterface());
                    model.setBindingInterfaceContract(interfaceContract);
                } catch (InvalidInterfaceException e) {
                  warning(monitor, "InvalidInterfaceException", wsdlFactory, model.getName(), e.getMessage());
                }
            }
View Full Code Here

        if (javaInterface != null && javaInterface.getJAXWSWSDLLocation() != null){
            WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface();
            wsdlInterface.setUnresolved(true);
            wsdlInterface.setRemotable(true);
           
            WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
            wsdlInterfaceContract.setInterface(wsdlInterface);
            wsdlInterfaceContract.setLocation(javaInterface.getJAXWSWSDLLocation());
            javaInterfaceContract.setNormalizedWSDLContract(wsdlInterfaceContract);
           
            ProcessorContext wsdlContext = new ProcessorContext(javaInterface.getContributionContainingClass(),
                                                                context.getMonitor());
            extensionProcessor.resolve(wsdlInterfaceContract, resolver, wsdlContext);
View Full Code Here

        InterfaceContract ic = getComponentServiceInterfaceContract();
        if (ic == null || ic.getInterface() == null || !ic.getInterface().isRemotable()) {
            return "";
        }
       
        WSDLInterfaceContract wsdlIC = null;
        try {
            wsdlIC = (WSDLInterfaceContract)getGeneratedWSDLContract(ic);
        } catch (Exception ex){
            // ignore WSDL generation errors as the service interface may have
            // types that can't be converted to XML easily
            return "";
        }
       
        if (wsdlIC == null) {
            return "";
        }
       
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
       
        try {
            // write out a flattened WSDL along with XSD
            WSDLInterface wsdl = (WSDLInterface)wsdlIC.getInterface();
            WSDLDefinition wsdlDefinition = wsdl.getWsdlDefinition();
            writeWSDL(outStream, wsdlDefinition);     
        } catch (Exception e){
            throw new RuntimeException(e);
        }
View Full Code Here

        InterfaceContract ic = getComponentServiceInterfaceContract();
        if (ic == null || ic.getCallbackInterface() == null || !ic.getCallbackInterface().isRemotable()) {
            return "";
        }
       
        WSDLInterfaceContract wsdlIC = null;
        try {
            wsdlIC = (WSDLInterfaceContract)getGeneratedWSDLContract(ic);
        } catch (Exception ex){
            // ignore WSDL generation errors as the service interface may have
            // types that can't be converted to XML easily
            return "";
        }
   
        if (wsdlIC == null) {
            return "";
        }
       
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
       
        try {
            // write out a flattened Callback WSDL along with XSD
            WSDLInterface wsdl = (WSDLInterface)wsdlIC.getCallbackInterface();
            WSDLDefinition wsdlDefinition = wsdl.getWsdlDefinition();
            writeWSDL(outStream, wsdlDefinition);     
        } catch (Exception e){
            throw new RuntimeException(e);
        }
View Full Code Here

                }
            }

            PortType portType = getPortType(model);
            if (portType != null) {
                WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
                WSDLInterface wsdlInterface;
                try {
                    wsdlInterface = introspector.introspect(portType,
                                                                          wsdlDefinition.getInlinedSchemas(),
                                                                          resolver);
                } catch (InvalidInterfaceException e) {
                    throw new ContributionResolveException(e);
                }
                interfaceContract.setInterface(wsdlInterface);
                model.setBindingInterfaceContract(interfaceContract);
            }
        }
    }
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.