Examples of RpcCall


Examples of org.apache.axis2.rpc.client.RPCCall

        OMElement ref = fac.createOMElement("reference", null);
        ref.addAttribute(fac.createOMAttribute("id", null, "1"));
        ref.setText("hello Axis2");
        envelope.getBody().addChild(ref);
        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);

        SOAPEnvelope env = call.invokeBlocking("echoString", envelope);
        assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "hello Axis2");
    }
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

        ref2.addAttribute(fac.createOMAttribute("id", null, "2"));
        ref2.setText("10");
        envelope.getBody().addChild(ref2);


        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);
        SOAPEnvelope env = call.invokeBlocking("add", envelope);
        assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "20");
    }
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

        OMElement ref = fac.createOMElement("reference", null);
        ref.addAttribute(fac.createOMAttribute("id", null, "1"));
        ref.setText("10");
        envelope.getBody().addChild(ref);
        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);

        SOAPEnvelope env = call.invokeBlocking("add", envelope);
        assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "20");
    }
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

            ref2.addAttribute(fac.createOMAttribute("id", null, "3"));
            ref2.setText("10");
            envelope.getBody().addChild(ref2);


            RPCCall call =
                    new RPCCall("target/test-resources/intregrationRepo");

            Options options = new Options();
            call.setClientOptions(options);
            options.setTo(targetEPR);
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            call.invokeBlocking("add", envelope);
            fail("This should fail with : " + "org.apache.axis2.AxisFault: Invalid reference :2");
        } catch (AxisFault axisFault) {
            String val = axisFault.getMessage();
            int index = val.indexOf("org.apache.axis2.AxisFault: Invalid reference :2");
            if (index < 0) {
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

        envelope.getBody().addChild(om3);
        String ref4 = "<reference id=\"4\">Colombo3</reference>";
        OMElement om4 = getOMelemnt(ref4, fac);
        envelope.getBody().addChild(om4);

        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);
        SOAPEnvelope env = call.invokeBlocking("editBean", envelope);
        OMElement response = env.getBody().getFirstElement();
        MyBean resBean = (MyBean) BeanSerializerUtil.deserialize(MyBean.class, response.getFirstElement());
        assertNotNull(resBean);
        assertEquals(resBean.getAge(), 159);
        call.close();
    }
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

        envelope.getBody().addChild(om3);
        String ref4 = "<reference id=\"4\">Colombo3</reference>";
        OMElement om4 = getOMelemnt(ref4, fac);
        envelope.getBody().addChild(om4);

        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);

        SOAPEnvelope env = call.invokeBlocking("beanOM", envelope);
        OMElement response = env.getBody().getFirstElement();
        MyBean resBean = (MyBean) BeanSerializerUtil.deserialize(MyBean.class, response.getFirstElement());
        assertNotNull(resBean);
        assertEquals(resBean.getAge(), 159);
        call.close();
    }
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

        envelope.getBody().addChild(om3);
        String ref4 = "<reference id=\"4\">Colombo3</reference>";
        OMElement om4 = getOMelemnt(ref4, fac);
        envelope.getBody().addChild(om4);

        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
        SOAPEnvelope env = call.invokeBlocking("omrefs", envelope);
        OMElement response = env.getBody().getFirstElement();

        ArrayList args = new ArrayList();
        args.add(boolean.class);

        Object [] resBean = BeanSerializerUtil.deserialize(response, args.toArray());
        assertNotNull(resBean);
        assertEquals(((Boolean) resBean[0]).booleanValue(), true);
        call.close();
    }
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

        envelope.getBody().addChild(getOMelemnt(str, fac));
        str = "<reference id=\"2\">\n" +
                "<town>Colombo3</town><number>1010</number>\n" +
                "</reference>";
        envelope.getBody().addChild(getOMelemnt(str, fac));
        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);
        SOAPEnvelope env = call.invokeBlocking("echoEmployee", envelope);
        Employee emp = (Employee) BeanSerializerUtil.deserialize(Employee.class, env.getBody().getFirstElement().getFirstElement());
        assertNotNull(emp);
    }
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

            throw new AxisFault(e);
        } catch (FactoryConfigurationError factoryConfigurationError) {
            throw new AxisFault(factoryConfigurationError);
        }
        envelope.getBody().addChild(staxOMBuilder.getDocumentElement());
        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);

        SOAPEnvelope env = call.invokeBlocking("handleArrayList", envelope);
        assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "abcdefghiklm10");
    }
View Full Code Here

Examples of org.apache.axis2.rpc.client.RPCCall

        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);

        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");
        call.setClientOptions(options);

        MyBean bean = new MyBean();
        bean.setAge(100);
        bean.setName("Deepal");
        bean.setValue(false);
        AddressBean ab = new AddressBean();
        ab.setNumber(1010);
        ab.setTown("Colombo3");
        bean.setAddress(ab);

        ArrayList args = new ArrayList();
        args.add(bean);

        ArrayList ret = new ArrayList();
        ret.add(MyBean.class);

        Object [] response = call.invokeBlocking(operationName, args.toArray(), ret.toArray());
        MyBean resBean = (MyBean) response[0];
        assertNotNull(resBean);
        assertEquals(resBean.getAge(), 100);
        call.close();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.