Package com.caucho.hessian.client

Examples of com.caucho.hessian.client.HessianProxyFactory.create()


        final ClassLoader loader = Thread.currentThread().getContextClassLoader();
        final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
        final SerializerFactory factory = new SerializerFactory(loader);
        factory.setAllowNonSerializable(true);
        clientFactory.setSerializerFactory(factory);
        final CdiService client = CdiService.class.cast(clientFactory.create(CdiService.class, "http://127.0.0.1:" + port + "/web/hessian/foo"));

        final Out out = client.call(new In("test"));
        assertThat(out, instanceOf(Out.class));
        assertEquals("test", out.value);
    }
View Full Code Here


        proxyFactory.setConnectTimeout(3000);
        proxyFactory.setReadTimeout(3000);
        proxyFactory.setHessian2Reply(false);
        proxyFactory.setDebug(true);
        try {
          AcrmApi api=proxyFactory.create(AcrmApi.class, url);
          System.out.println(api.login("guxuede", "123"));
          //System.out.println(api.getContacts());
          //System.out.println(api.uglilyCode("hessian"));
          //System.out.println(api.getContacts());
          //System.out.println(api.logout());
View Full Code Here

        proxyFactory.setConnectionFactory(connFactory);
        connFactory.setHessianProxyFactory(proxyFactory);

      try {
        IWeibo weibo;
        weibo = (IWeibo) proxyFactory.create(IWeibo.class, url);
        System.out.println(weibo.getContacts());
      } catch (Exception e) {
        System.out.println("Exception:"+ ((InteractionException)e).getTypeId());
        e.printStackTrace();
      }
View Full Code Here

        e.printStackTrace();
      }
     
      try {
        IWeibo weibo;
        weibo = (IWeibo) proxyFactory.create(IWeibo.class, url);
        System.out.println(weibo.getContacts());
      } catch (Exception e) {
        System.out.println("Exception:"+ ((InteractionException)e).getTypeId());
        e.printStackTrace();
      }
View Full Code Here

        String url = "http://localhost:8080/HessianServer/hessianService";
        HessianProxyFactory factory = new HessianProxyFactory();
        factory.setUser("guxuede");
        factory.setPassword("dg23hhjs");
        try {
            IEye hello = (IEye) factory.create(IEye.class, url);
            hello.look();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

        HessianProxyFactory factory = new HessianProxyFactory();
        factory.setUser("guxuede");
        factory.setPassword("dg23hhjs");
        System.out.println(factory.getBasicAuth());
        try {
            HelloHessian hello = (HelloHessian) factory.create(HelloHessian.class, url);
            System.out.println(hello.sayHello());
            MyCar car = hello.getMyCar();
            System.out.println(car.toString());
            for (Map.Entry<String, String> entry : hello.myBabays().entrySet()) {
                System.out.println(entry.getKey() + "   " + entry.getValue());
View Full Code Here

        final ClassLoader loader = Thread.currentThread().getContextClassLoader();
        final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
        final SerializerFactory factory = new SerializerFactory(loader);
        factory.setAllowNonSerializable(true);
        clientFactory.setSerializerFactory(factory);
        final CdiService client = CdiService.class.cast(clientFactory.create(CdiService.class, "http://127.0.0.1:" + port + "/web/hessian/service"));

        final Out out = client.call(new In("test"));
        assertThat(out, instanceOf(Out.class));
        assertEquals("test", out.value);
    }
View Full Code Here

        final ClassLoader loader = Thread.currentThread().getContextClassLoader();
        final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
        final SerializerFactory factory = new SerializerFactory(loader);
        factory.setAllowNonSerializable(true);
        clientFactory.setSerializerFactory(factory);
        final CdiService client = CdiService.class.cast(clientFactory.create(CdiService.class, "http://127.0.0.1:" + port + "/web/hessian/foo"));

        final Out out = client.call(new In("test"));
        assertThat(out, instanceOf(Out.class));
        assertEquals("test", out.value);
    }
View Full Code Here

        final ClassLoader loader = Thread.currentThread().getContextClassLoader();
        final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
        final SerializerFactory factory = new SerializerFactory(loader);
        factory.setAllowNonSerializable(true);
        clientFactory.setSerializerFactory(factory);
        final HessianWebService client = HessianWebService.class.cast(clientFactory.create(HessianWebService.class, "http://127.0.0.1:" + port + "/HessianServiceTest/hessian/" + MyHessianWebService.class.getSimpleName()));

        final Out out = client.call(new In("test"));
        assertThat(out, instanceOf(Out.class));
        assertEquals("test", out.value);
    }
View Full Code Here

        final ClassLoader loader = Thread.currentThread().getContextClassLoader();
        final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
        final SerializerFactory factory = new SerializerFactory(loader);
        factory.setAllowNonSerializable(true);
        clientFactory.setSerializerFactory(factory);
        final HessianWebService client = HessianWebService.class.cast(clientFactory.create(HessianWebService.class, "http://127.0.0.1:4204/HessianServiceTest/hessian/" + MyHessianWebService.class.getSimpleName()));

        final Out out = client.call(new In("test"));
        assertThat(out, instanceOf(Out.class));
        assertEquals("test", out.value);
    }
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.