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

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


        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


                }
            }

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

            JavaInterface javaInterface = (JavaInterface)javaInterfaceContract.getInterface();
            if (javaInterface.isUnresolved()){            
                extensionProcessor.resolve(javaInterfaceContract, resolver, context);
            }
           
            WSDLInterfaceContract wsdlInterfaceContract = (WSDLInterfaceContract)javaInterfaceContract.getNormalizedWSDLContract();
            if(wsdlInterfaceContract != null){
                // The user has explicitly associated a WSDL with the Java implementation
                // using a @WebService(wsdlLocation="...") annotation
                WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
                if (wsdlInterface.isUnresolved()){
                    //WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlInterface.getWsdlDefinition(), context);
                    extensionProcessor.resolve(wsdlInterfaceContract, resolver, context);
                   
                    // check that the Java and WSDL contracts are compatible
                    interfaceContractMapper.checkCompatibility(wsdlInterfaceContract,
                                                               javaInterfaceContract,
                                                               Compatibility.SUBSET,
                                                               false,
                                                               false);
                   
                    // retrieve the resolved WSDL interface
                    wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
                   
                    // copy policy from the WSDL interface to the Java interface
                    javaInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
                    javaInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
                   
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

    public boolean build(InterfaceContract interfaceContract, BuilderContext context){
// 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);
        WSDLInterfaceContract wsdlIC2 = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC2, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, documentBuilderFactory, null);
        assertNotNull(wsdlIC2);
    }
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.setNormailizedWSDLContract(wsdlInterfaceContract);
           
            ProcessorContext wsdlContext = new ProcessorContext(javaInterface.getContributionContainingClass(),
                                                                context.getMonitor());
            extensionProcessor.resolve(wsdlInterfaceContract, resolver, wsdlContext);
View Full Code Here

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

                  ContributionResolveException ce = new ContributionResolveException("WSDL binding operation output name " + operation.getOutput().getName() + " does not match with PortType Definition");
                        error("ContributionResolveException", wsdlDefinition, ce);
                }
              }

                WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
                WSDLInterface wsdlInterface = null;
                try {
                    wsdlInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver);
                    interfaceContract.setInterface(wsdlInterface);
                    model.setBindingInterfaceContract(interfaceContract);
                } catch (InvalidInterfaceException e) {
                  warning("InvalidInterfaceException", wsdlFactory, model.getName());
                }
            }
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);
        }
       
        // Handle extended attributes
        for (int a = 0; a < reader.getAttributeCount(); a++) {
            QName attributeName = reader.getAttributeName(a);
            if( attributeName.getNamespaceURI() != null && attributeName.getNamespaceURI().length() > 0) {
                if( (! Constants.SCA10_NS.equals(attributeName.getNamespaceURI()) &&
                    (! Constants.SCA10_TUSCANY_NS.equals(attributeName.getNamespaceURI()) ))) {
                    Object attributeValue = extensionAttributeProcessor.read(attributeName, reader);
                    Extension attributeExtension;
                    if (attributeValue instanceof Extension) {
                        attributeExtension = (Extension) attributeValue;
                    } else {
                        attributeExtension = extensionFactory.createExtension(attributeName, attributeValue, true);
                    }
                    wsdlInterfaceContract.getAttributeExtensions().add(attributeExtension);
                }
            }
        }               
           
        // Skip to end element
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.