Package org.apache.axis2.rpc.client

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


        QName opAddEntry = new QName("http://rpc.axis2.apache.org", "getEntries1");

        Object[] opAddEntryArgs = new Object[] { };

        // Invoking the method
        RPCServiceClient serviceClient = getRPCClient();
        Options options = serviceClient.getOptions();
        EndpointReference targetEPR = new EndpointReference(
                "local://services/AddressBookService");
        options.setTo(targetEPR);
        options.setAction("getEntries1");

        Object[] result = serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, new Class[]{Entry[].class});
        assertNotNull(result);
        Entry[] entries = (Entry[]) result[0];
        assertEquals(entries.length, 2);
    }
View Full Code Here


        QName opAddEntry = new QName("http://rpc.axis2.apache.org", "getEntries2");

        Object[] opAddEntryArgs = new Object[] { };

        // Invoking the method
        RPCServiceClient serviceClient = getRPCClient();
        Options options = serviceClient.getOptions();
        EndpointReference targetEPR = new EndpointReference(
                "local://services/AddressBookService");
        options.setTo(targetEPR);
        options.setAction("getEntries2");

        Object[] result = serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, new Class[]{Entry[].class});
        assertNotNull(result);
        Entry[] entries = (Entry[]) result[0];
        assertEquals(entries.length, 0);
    }
View Full Code Here

        QName opAddEntry = new QName("http://rpc.axis2.apache.org", "getEntries3");

        Object[] opAddEntryArgs = new Object[] { };

        // Invoking the method
        RPCServiceClient serviceClient = getRPCClient();
        Options options = serviceClient.getOptions();
        EndpointReference targetEPR = new EndpointReference(
                "local://services/AddressBookService");
        options.setTo(targetEPR);
        options.setAction("getEntries3");

        Object[] result = serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, new Class[]{Entry[].class});
        assertNotNull(result);
        Entry[] entries = (Entry[]) result[0];
        assertEquals(entries.length, 0);
    }
View Full Code Here

        assertNotNull(messge);
        assertNotNull(messge.getSchemaElement());
        assertNotNull(service.getOperation(new QName("putValue")));
        assertNotNull(axisConfig.getService("MyService"));

        RPCServiceClient client = new RPCServiceClient(clinetConfigurationctx, null);

        EndpointReference targetEPR = new EndpointReference(
                "http://127.0.0.1:" + (UtilServer.TESTING_PORT)
                        + "/axis2/services/MyService/add");
        Options options = new Options();

        options.setTo(targetEPR);
        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
        client.setOptions(options);
        ArrayList args = new ArrayList();
        args.add("100");
        args.add("200");

        OMElement response = client.invokeBlocking(
                new QName("http://engine.axis2.apache.org", "add", "ns1"), args.toArray());
        assertEquals(Integer.parseInt(response.getFirstElement().getText()), 300);
    }
View Full Code Here

        if (this.enable) {

            try {

                RPCServiceClient serviceClient = new RPCServiceClient();

                Options options = serviceClient.getOptions();

                EndpointReference targetEPR = new EndpointReference(
                        this.endpointReference);

                options.setTo(targetEPR);

                // Setting the bean
                QName opSetter = new QName(this.namespaceURI, serviceName);

                serviceClient.invokeRobust(opSetter, opSetterArgs);

            } catch (Exception e) {
                result = e;
            }
        }
View Full Code Here

        Object[] result = null;

        if (this.enable) {

            try {
                RPCServiceClient serviceClient = new RPCServiceClient();

                Options options = serviceClient.getOptions();

                EndpointReference targetEPR = new EndpointReference(
                        this.endpointReference);

                options.setTo(targetEPR);

                // Setting the bean
                QName opGetter = new QName(this.namespaceURI, serviceName);

                Object[] response = serviceClient.invokeBlocking(opGetter,
                        opGetterArgs, returnTypes);

                if (response != null) {
                    result = response;
                }
View Full Code Here

      
    }
    public void runClient() throws Exception {
      System.out.println("Enter service epr address :          ");
        String epr = getInput();
        RPCServiceClient rpcClient = new RPCServiceClient();
        Options opts = new Options();
        opts.setTo(new EndpointReference(epr));
        rpcClient.setOptions(opts);
        LibraryServiceClient client = new LibraryServiceClient();
        while (true) {
          showOptions();
            System.out.println("Type your command here : ");
            String commandsParms = getInput();
View Full Code Here

    super.setUp();
    deployClassAsService("EchoXMLService", RPCServiceClass.class);
  }

    public void testEditBean() throws AxisFault {
        RPCServiceClient sender = getRPCClient("EchoXMLService", "editBean");

        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);
        args.add("159");

        OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "editBean", "req"), args.toArray());
        MyBean resBean = (MyBean)BeanUtil.deserialize(MyBean.class, response.getFirstElement(),
                                                      new DefaultObjectSupplier(), null);
        assertNotNull(resBean);
        assertEquals(resBean.getAge(), 159);
    }
View Full Code Here

        assertNotNull(resBean);
        assertEquals(resBean.getAge(), 159);
    }

    public void testEchoBean() throws AxisFault {
      RPCServiceClient sender = getRPCClient("EchoXMLService", "echoBean");

        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);


        OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "echoBean", "req"), args.toArray());
        MyBean resBean = (MyBean)BeanUtil.deserialize(MyBean.class,
                                                      response.getFirstElement(),
                                                      new DefaultObjectSupplier(), null);
//        MyBean resBean =(MyBean) new  BeanSerializer(MyBean.class,response).deserilze();
        assertNotNull(resBean);
View Full Code Here

        assertNotNull(resBean);
        assertEquals(resBean.getAge(), 100);
    }

    public void testechoMail() throws AxisFault {
      RPCServiceClient sender = getRPCClient("EchoXMLService", "echoMail");

        Mail mail = new Mail();
        mail.setBody("My Body");
        mail.setContentType("ContentType");
        mail.setFrom("From");
        mail.setId("ID");
        mail.setSubject("Subject");
        mail.setTo("To");

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


        OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "echoMail", "req"), args.toArray());
        Mail resBean = (Mail)BeanUtil.deserialize(Mail.class, response.getFirstElement(),
                                                  new DefaultObjectSupplier(), null);
//        MyBean resBean =(MyBean) new  BeanSerializer(MyBean.class,response).deserilze();
        assertNotNull(resBean);
        assertEquals(resBean.getBody(), "My Body");
View Full Code Here

TOP

Related Classes of org.apache.axis2.rpc.client.RPCServiceClient

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.