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

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


    /**
     * Convert a WSDL interface to an interface contract.
     */
    static WSDLInterfaceContract contract(final WSDLInterface wi, final WSDLFactory wf) {
        final WSDLInterfaceContract ic = wf.createWSDLInterfaceContract();
        ic.setInterface(wi);
        return ic;
    }
View Full Code Here


        Definition def = createDefinition(pkg2nsMap, iface.getJavaClass(), requiresSOAP12);

        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

                }
            }

            PortType portType = getPortType(model);
            if (portType != null) {
                WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
                WSDLInterface wsdlInterface = null;
                try {
                    wsdlInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver, context.getMonitor());
                } catch (InvalidInterfaceException e) {
                  warning(monitor, "InvalidInterfaceException", wsdlFactory, model.getName(), e.getMessage());
                }
                interfaceContract.setInterface(wsdlInterface);
                interfaceContract.setCallbackInterface(wsdlInterface.getCallbackInterface());
                model.setBindingInterfaceContract(interfaceContract);
            }
           
            validateWSDL(context, model);
        } else {
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

                                                                       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

        getComponent().getServices().add(service);
       
        // if the reference has a WSDL contract reset the response endpoint to be WSDL also
        InterfaceContract referenceInterfaceContract = getComponentTypeReferenceInterfaceContract();
        if (referenceInterfaceContract instanceof WSDLInterfaceContract){
            WSDLInterfaceContract wsdlInterfaceContract = (WSDLInterfaceContract)endpoint.getGeneratedWSDLContract(interfaceContract);
            service.setInterfaceContract(wsdlInterfaceContract);
        }        

        // Create a binding
        // Mike had to go via the XML but I don't remember why
View Full Code Here

    private String getWsdl() {
        InterfaceContract ic = getComponentServiceInterfaceContract();
        if (ic == null || ic.getInterface() == null || !!!ic.getInterface().isRemotable()) {
            return "";
        }
        WSDLInterfaceContract wsdlIC = (WSDLInterfaceContract)getGeneratedWSDLContract(getComponentServiceInterfaceContract());
        if (wsdlIC == null) {
            return "";
        }
        WSDLInterface wsdl = (WSDLInterface)wsdlIC.getInterface();
        WSDLDefinition d = wsdl.getWsdlDefinition();
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        try {
            WSDLWriter writer = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
            writer.writeWSDL(d.getDefinition(), outStream);
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

        Definition def = createDefinition(pkg2nsMap, iface.getJavaClass(), requiresSOAP12);

        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

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