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

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


    }
   
    public void resolve(WSDLInterfaceContract wsdlInterfaceContract, ModelResolver resolver) throws ContributionResolveException {
       
        // Resolve the interface and callback interface
        WSDLInterface wsdlInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getInterface(), resolver);
        wsdlInterfaceContract.setInterface(wsdlInterface);
       
        WSDLInterface wsdlCallbackInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getCallbackInterface(), resolver);
        wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
    }
View Full Code Here


    }
   
    public WSDLInterface createWSDLInterface(PortType portType,
                                             WSDLDefinition wsdlDefinition,
                                             ModelResolver resolver) throws InvalidInterfaceException {
        WSDLInterface wsdlInterface = createWSDLInterface();
        introspector.introspectPortType(wsdlInterface, portType, wsdlDefinition, resolver);
        return wsdlInterface;
    }
View Full Code Here

        if(true){
            __log.debug("Initializing BPELInvoker");
        }
        Interface interfaze = operation.getInterface();
        if(interfaze instanceof WSDLInterface){
            WSDLInterface wsdlInterface = null;
            wsdlInterface = (WSDLInterface) interfaze;
           
            // The following commented out code is bogus and is replaced by what follows - Mike Edwards
            // Service serviceDefinition = (Service) wsdlInterface.getWsdlDefinition().getDefinition().getAllServices().values().iterator().next();
            // bpelServiceName = serviceDefinition.getQName();
            //
            // Fetch the service name from the service object
            bpelServiceName = new QName( "http://tuscany.apache.org", service.getName() );
            //System.out.println("Actual service QName: " + bpelServiceName );
               
            bpelOperationInputPart = (Part) wsdlInterface.getPortType().getOperation(bpelOperationName,null,null).getInput().getMessage().getParts().values().iterator().next();
            bpelOperationOutputPart = (Part) wsdlInterface.getPortType().getOperation(bpelOperationName,null,null).getOutput().getMessage().getParts().values().iterator().next();
        }
    }
View Full Code Here

        portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
    }

    @SuppressWarnings("unchecked")
    public final void testIntrospectPortType() throws InvalidInterfaceException {
        WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver);
        Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
        List<Operation> operations = contract.getOperations();
        Assert.assertEquals(1, operations.size());
        Operation operation = operations.get(0);
        Assert.assertEquals("getLastTradePrice", operation.getName());
        DataType<List<DataType>> inputType = operation.getInputType();
        Assert.assertEquals(1, inputType.getLogical().size());
View Full Code Here

        portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
    }

    @SuppressWarnings("unchecked")
    public final void testIntrospectPortType() throws InvalidInterfaceException {
        WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver);
        Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
        Assert.assertTrue(contract.isConversational());
       
        boolean foundIntent = false;
       
        for(Intent intent : contract.getRequiredIntents()) {
            if(INTENT.equals(intent.getName())) {
                foundIntent = true;
            }
        }
       
        Assert.assertTrue(foundIntent);
       
        for(Operation operation : contract.getOperations()) {
            if(operation.getName().equals("cancel")) {
                Assert.assertEquals(operation.getConversationSequence(), ConversationSequence.CONVERSATION_END);
            }
        }
       
View Full Code Here

        reference.setName(name);
        reference.setMultiplicity(Multiplicity.ONE_ONE);

        if (callPT != null) {
            // Set the call interface and, if present, the callback interface
            WSDLInterface callInterface = null;
            for (WSDLInterface anInterface : theInterfaces) {
                if (anInterface.getPortType().getQName().equals(callPT.getQName()))
                    callInterface = anInterface;
            } // end for
            if (callInterface == null) {
                error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
            } else
                reference.getInterfaceContract().setInterface(callInterface);
        }

        // There is a callback if the partner role is not null and if the
        // partner role port type
        // is not the same as the port type for my role
        if (callbackPT != null) {
            WSDLInterface callbackInterface = null;
            for (WSDLInterface anInterface : theInterfaces) {
                if (anInterface.getPortType().getQName().equals(callbackPT.getQName()))
                    callbackInterface = anInterface;
            } // end for
            if (callbackInterface == null) {
View Full Code Here

            error("MyRolePartnerRoleNull", theInterfaces);
        } // end if

        if (callPT != null) {
            // Set the call interface and, if present, the callback interface
            WSDLInterface callInterface = null;
            for (WSDLInterface anInterface : theInterfaces) {
                if (anInterface.getPortType().getQName().equals(callPT.getQName()))
                    callInterface = anInterface;
            } // end for
            if (callInterface == null) {
                error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
            } else
                service.getInterfaceContract().setInterface(callInterface);
        } // end if

        // There is a callback if the partner role is not null and if the
        // partner role port type
        // is not the same as the port type for my role
        if (callbackPT != null) {
            WSDLInterface callbackInterface = null;
            for (WSDLInterface anInterface : theInterfaces) {
                if (anInterface.getPortType().getQName().equals(callbackPT.getQName()))
                    callbackInterface = anInterface;
            } // end for
            if (callbackInterface == null) {
View Full Code Here

                    thePortTypes.addAll(portTypes);

                    // Create WSDLInterface elements for each PortType found
                    for (PortType portType : portTypes) {
                        WSDLObject<PortType> wsdlPortType = theWSDL.getWSDLObject(PortType.class, portType.getQName());
                        WSDLInterface wsdlInterface;
                        if (wsdlPortType != null) {
                            // Introspect the WSDL portType and add the resulting
                            // WSDLInterface to the resolver
                            try {
                                theWSDL.setDefinition(wsdlPortType.getDefinition());
                                wsdlInterface = WSDLfactory.createWSDLInterface(wsdlPortType.getElement(), theWSDL, resolver);
                                wsdlInterface.setWsdlDefinition(theWSDL);
                            } catch (InvalidInterfaceException e) {
                                ContributionResolveException ce = new ContributionResolveException(e);
                                error("ContributionResolveException", resolver, ce);
                                throw ce;
                            } // end try
View Full Code Here

        }

        // add a service and ports to the generated definition 
        WSDLDefinitionGenerator helper =
                new WSDLDefinitionGenerator(BindingWSDLGenerator.requiresSOAP12(wsBinding),false);
        WSDLInterface wi = (WSDLInterface)wsBinding.getBindingInterfaceContract().getInterface();
        PortType portType = wi.getPortType();
        Service service = helper.createService(def, portType);
        if (wsBinding.getBinding() == null && ports.size() == 0) {
            Binding binding = helper.createBinding(def, portType);
            if (BindingWSDLGenerator.requiresSOAP12(wsBinding)) {
                def.addNamespace("SOAP12", "http://schemas.xmlsoap.org/wsdl/soap12/");
View Full Code Here

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

TOP

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

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.