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

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


        WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url, context);
        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
        WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
        WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
        Assert.assertFalse(op.isWrapperStyle());
        op = (WSDLOperation) wi.getOperations().get(2);
        Assert.assertFalse(op.isWrapperStyle());
    }
View Full Code Here


        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
       
        WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
        WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);

        DataType<List<DataType>> inputType = op.getInputType();
        Assert.assertEquals(1, inputType.getLogical().size());
        DataType<XMLType> type = inputType.getLogical().get(0);
        Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName());

        DataType<XMLType> outputType = op.getOutputType();
        Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"),
                            outputType.getLogical().getElementName());
        Assert.assertTrue(op.isWrapperStyle());

        DataType<List<DataType>> unwrappedInputType = op.getWrapper().getUnwrappedInputType();
        List<DataType> childTypes = unwrappedInputType.getLogical();
        Assert.assertEquals(1, childTypes.size());
        DataType<XMLType> childType = childTypes.get(0);
        Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName());

        childType = op.getWrapper().getUnwrappedOutputType();
        Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName());
    }
View Full Code Here

        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);

        WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
        WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
        Assert.assertFalse(op.isWrapperStyle());
        Assert.assertEquals(1, op.getInputType().getLogical().size());

        op = (WSDLOperation) wi.getOperations().get(2);
        Assert.assertFalse(op.isWrapperStyle());
        Assert.assertEquals(2, op.getInputType().getLogical().size());
    }
View Full Code Here

        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);

        try {
            WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
            WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);

            op.isWrapperStyle();
            fail("InvalidWSDLException should have been thrown");
        } catch (InvalidInterfaceException e) {
            // Expected
        }
View Full Code Here

        WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url, context);
        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
        WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
        WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
        Assert.assertTrue(op.isWrapperStyle());
        Assert.assertEquals(1, op.getWrapper().getInputChildElements().size());
        Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size());
    }
View Full Code Here

        WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url, context);
        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
        WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
        WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
        Assert.assertFalse(op.isWrapperStyle());
        op = (WSDLOperation) wi.getOperations().get(2);
        Assert.assertFalse(op.isWrapperStyle());
    }
View Full Code Here

        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
       
        WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
        WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);

        DataType<List<DataType>> inputType = op.getInputType();
        Assert.assertEquals(1, inputType.getLogical().size());
        DataType<XMLType> type = inputType.getLogical().get(0);
        Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName());

        DataType<XMLType> outputType = op.getOutputType();
        Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"),
                            outputType.getLogical().getElementName());
        Assert.assertTrue(op.isWrapperStyle());

        DataType<List<DataType>> unwrappedInputType = op.getWrapper().getUnwrappedInputType();
        List<DataType> childTypes = unwrappedInputType.getLogical();
        Assert.assertEquals(1, childTypes.size());
        DataType<XMLType> childType = childTypes.get(0);
        Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName());

        childType = op.getWrapper().getUnwrappedOutputType();
        Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName());
    }
View Full Code Here

        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);

        WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
        WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
        Assert.assertFalse(op.isWrapperStyle());
        Assert.assertEquals(1, op.getInputType().getLogical().size());

        op = (WSDLOperation) wi.getOperations().get(2);
        Assert.assertFalse(op.isWrapperStyle());
        Assert.assertEquals(2, op.getInputType().getLogical().size());
    }
View Full Code Here

        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);

        try {
            WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
            WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);

            op.isWrapperStyle();
            fail("InvalidWSDLException should have been thrown");
        } catch (InvalidInterfaceException e) {
            // Expected
        }
View Full Code Here

        WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url, context);
        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
        WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
        WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
        Assert.assertTrue(op.isInputWrapperStyle());
        Assert.assertEquals(1, op.getInputWrapper().getChildElements().size());
        Assert.assertEquals(1, op.getOutputWrapper().getChildElements().size());
    }
View Full Code Here

TOP

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

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.