Package org.apache.tuscany.sca.interfacedef

Examples of org.apache.tuscany.sca.interfacedef.Operation


        }

        msg = getNext().invoke(msg);

        //if it's oneway return back
        Operation operation = msg.getOperation();
        if (operation != null && operation.isNonBlocking()) {
            return msg;
        }

        if (binding.getResponseWireFormat() instanceof XMLWireFormat) {
            msg = invokeResponse(bindingContext, msg);
View Full Code Here


        }

        msg = getNext().invoke(msg);

        //if it's oneway return back
        Operation operation = msg.getOperation();
        if (operation != null && operation.isNonBlocking()) {
            return msg;
        }

        if (binding.getResponseWireFormat() instanceof JSONWireFormat) {
            msg = invokeResponse(bindingContext, msg);
View Full Code Here

        if (context == null) {
            return getDefaultHelperContext();
        }

        HelperContext helperContext = null;
        Operation op = source ? context.getSourceOperation() : context.getTargetOperation();
        if (op == null) {
            DataType<?> dt = source ? context.getSourceDataType() : context.getTargetDataType();

            helperContext = dt.getMetaData(HelperContext.class);
            if (helperContext != null) {
View Full Code Here

    }

    public void testWrapperAnyType() throws Exception {
        XMLHelper xmlHelper = context.getXMLHelper();
        XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
        Operation op = new OperationImpl();
        List children = handler.getChildren(document, op, true);
        assertEquals(5, children.size());
    }
View Full Code Here

    public void testWrapper() throws Exception {
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
        XMLHelper xmlHelper = context.getXMLHelper();
        XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
        Operation op = new OperationImpl();
        List children = handler.getChildren(document, op, true);
        assertEquals(5, children.size());
    }
View Full Code Here

    public void testCreate() {
        HelperContext context = HelperProvider.getDefaultContext();
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
        ElementInfo element = new ElementInfo(new QName("http://www.example.com/wrapper", "op"), null);
        Operation op = new OperationImpl();
        WrapperInfo wrapperInfo = new WrapperInfo(SDODataBinding.NAME, element, null, null, null);
        op.setWrapper(wrapperInfo);
        DataObject wrapper = (DataObject) handler.create(op, true);
        assertNotNull(wrapper);
    }
View Full Code Here

    public void testWrapper() throws Exception {
        DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory(registry);
        JavaInterface contract = iFactory.createJavaInterface(StockExceptionTest.class);

        // interfaceProcessor.visitInterface(contract);
        Operation op = contract.getOperations().get(0);
        Assert.assertTrue(!op.isWrapperStyle());
        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOffer"), op.getWrapper().getInputWrapperElement().getQName());
        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOfferResponse"), op.getWrapper().getOutputWrapperElement().getQName());
    }
View Full Code Here

        contract = iFactory.createJavaInterface(WebServiceInterfaceWithAnnotation.class);
        // interfaceProcessor.visitInterface(contract);
        assertTrue(contract.isRemotable());

        Operation op1 = contract.getOperations().get(0);
        Operation op2 = contract.getOperations().get(1);

        Operation op = null;
        if ("m1".equals(op1.getName())) {
            op = op1;
        } else {
            op = op2;
        }

        assertTrue(!op.isWrapperStyle() && op.getWrapper() == null);

        if ("M2".equals(op2.getName())) {
            op = op2;
        } else {
            op = op1;
        }
        assertTrue(!op.isWrapperStyle() && op.getWrapper() != null);

    }
View Full Code Here

                path = path.substring(1);
            }


            String operationName = bindingContext.getHttpRequest().getParameter("method");
            Operation operation = findOperation( operationName );

            if (operation == null) {
                throw new RuntimeException("Invalid Operation '" + operationName + "'" );
            }
View Full Code Here

            method = method.substring(method.lastIndexOf(".") + 1);
        }

        List<Operation> operations = endpoint.getComponentServiceInterfaceContract().getInterface().getOperations();

        Operation result = null;
        for (Operation o : operations) {
            if (o.getName().equalsIgnoreCase(method)) {
                result = o;
                break;
            }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.Operation

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.