Package org.apache.axis2.rmi.metadata

Examples of org.apache.axis2.rmi.metadata.Operation


    public void testMethod31() {

        try {
            // first create service data

            Operation operation = this.service.getOperation("method3");
            // get objects after serialization and deserialization.
            // this returned objects mustbe identical with the original array list elements
            List inputObjects = new ArrayList();
            TestClass2 testClass2 = new TestClass2();
            testClass2.setParam1(1);
            testClass2.setParam2(34.5f);
            testClass2.setParam3(23.5);
            inputObjects.add(testClass2);
            Object[] objects = getInputObject(inputObjects, operation);

            TestClass2 object = (TestClass2) operation.getJavaMethod().invoke(this.serviceObject, objects);
            TestClass2 returnObject = (TestClass2) getReturnObject(object, operation);

            assertEquals(returnObject.getParam1(), 1);
            assertTrue(returnObject.getParam2() == 34.5f);
            assertTrue(returnObject.getParam3() == 23.5);
View Full Code Here


    public void testMethod32() {

        try {
            // first create service data

            Operation operation = this.service.getOperation("method3");
            // get objects after serialization and deserialization.
            // this returned objects mustbe identical with the original array list elements
            List inputObjects = new ArrayList();
            inputObjects.add(null);
            Object[] objects = getInputObject(inputObjects, operation);

            TestClass2 object = (TestClass2) operation.getJavaMethod().invoke(this.serviceObject, objects);
            TestClass2 returnObject = (TestClass2) getReturnObject(object, operation);

            assertNull(returnObject);
        } catch (Exception e) {
            fail();
View Full Code Here

    public void testMethod41() {

        try {
            // first create service data

            Operation operation = this.service.getOperation("method4");
            // get objects after serialization and deserialization.
            // this returned objects mustbe identical with the original array list elements
            List inputObjects = new ArrayList();

            TestClass2 testClass21 = new TestClass2();
            testClass21.setParam1(1);
            testClass21.setParam2(34.5f);
            testClass21.setParam3(23.5);

            TestClass2 testClass22 = new TestClass2();
            testClass22.setParam1(1);
            testClass22.setParam2(34.5f);
            testClass22.setParam3(23.5);

            TestClass2 testClass23 = new TestClass2();
            testClass23.setParam1(1);
            testClass23.setParam2(34.5f);
            testClass23.setParam3(23.5);

            inputObjects.add(new TestClass2[]{testClass21,testClass22,testClass23});
            Object[] objects = getInputObject(inputObjects, operation);

            TestClass2[] object = (TestClass2[]) operation.getJavaMethod().invoke(this.serviceObject, objects);
            TestClass2[] returnObject = (TestClass2[]) getReturnObject(object, operation);

            assertEquals(returnObject[0].getParam1(), 1);
            assertTrue(returnObject[0].getParam2() == 34.5f);
            assertTrue(returnObject[0].getParam3() == 23.5);
View Full Code Here

    public void testMethod1(){
        try {
            // first create service data

            Operation operation = this.service.getOperation("method1");
            // get objects after serialization and deserialization.
            // this returned objects mustbe identical with the original array list elements
            List inputObjects = new ArrayList();
            ChildClass childClass = new ChildClass();
            childClass.setParam1("test param1");
            childClass.setParam2(5);
            childClass.setParam3(23.45f);
            childClass.setParam4(34.5);
            inputObjects.add(childClass);
            Object[] objects = getInputObject(inputObjects, operation);

            ChildClass object = (ChildClass) operation.getJavaMethod().invoke(this.serviceObject, objects);
            ChildClass returnObject = (ChildClass) getReturnObject(object, operation);

            assertEquals(returnObject.getParam1(),"test param1");
            assertEquals(returnObject.getParam2(),5);
            assertTrue(childClass.getParam3() == 23.45f);
View Full Code Here

    public void testMethod21(){
        try {
            // first create service data

            Operation operation = this.service.getOperation("method2");
            // get objects after serialization and deserialization.
            // this returned objects mustbe identical with the original array list elements
            List inputObjects = new ArrayList();
            inputObjects.add(new Object());
            Object[] objects = getInputObject(inputObjects, operation);

            Object object = operation.getJavaMethod().invoke(this.serviceObject, objects);
            Object returnObject = getReturnObject(object, operation);

            assertNotNull(returnObject);
        } catch (Exception e) {
            fail();
View Full Code Here

    public void testMethod22(){
        try {
            // first create service data

            Operation operation = this.service.getOperation("method2");
            // get objects after serialization and deserialization.
            // this returned objects mustbe identical with the original array list elements
            List inputObjects = new ArrayList();
            Date date = new Date();
            inputObjects.add(date);
            Object[] objects = getInputObject(inputObjects, operation);

            Date object = (Date) operation.getJavaMethod().invoke(this.serviceObject, objects);
            Date returnObject = (Date) getReturnObject(object, operation);

            assertEquals(returnObject.getDate(),date.getDate());
        } catch (Exception e) {
            fail();
View Full Code Here

    }

    public Object invokeMethod(String operationName,
                               Object[] inputObjects) throws Exception {

        Operation operation = this.service.getOperation(operationName);
        OMElement inputOMElement = getInputOMElement(inputObjects,
                operation,
                this.javaObjectSerializer,
                OMAbstractFactory.getOMFactory());
        this.getOptions().setAction("urn:" + operationName);
View Full Code Here

            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here

            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.rmi.metadata.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.