rpc

Download dynamic file with GWT

你。 提交于 2019-12-04 19:18:51
问题 I have a GWT page where user enter data (start date, end date, etc.), then this data goes to the server via RPC call. On the server I want to generate Excel report with POI and let user save that file on their local machine. This is my test code to stream file back to the client but for some reason I think it does not know how to stream file to the client when I'm using RPC: public class ReportsServiceImpl extends RemoteServiceServlet implements ReportsService { public String myMethod(String

远程过程调用(RPC)详解

萝らか妹 提交于 2019-12-04 18:56:07
原文同步至 http://waylau.com/remote-procedure-calls/ 本文介绍了什么是远程过程调用(RPC),RPC 有哪些常用的方法,RPC 经历了哪些发展阶段,以及比较了各种 RPC 技术的优劣。 什么是 RPC RPC 是远程过程调用(Remote Procedure Call)的缩写形式,Birrell 和 Nelson 在 1984 发表于 ACM Transactions on Computer Systems 的论文《Implementing remote procedure calls》对 RPC 做了经典的诠释。RPC 是指计算机 A 上的进程,调用另外一台计算机 B 上的进程,其中 A 上的调用进程被挂起,而 B 上的被调用进程开始执行,当值返回给 A 时,A 进程继续执行。调用方可以通过使用参数将信息传送给被调用方,而后可以通过传回的结果得到信息。而这一过程,对于开发人员来说是透明的。 图1 描述了数据报在一个简单的RPC传递的过程 注:上述论文,可以在线阅读 http://www.cs.virginia.edu/~zaher/classes/CS656/birrel.pdf 。 远程过程调用采用客户机/服务器(C/S)模式。请求程序就是一个客户机,而服务提供程序就是一台服务器。和常规或本地过程调用一样,远程过程调用是同步操作

Session management in gwt

不羁岁月 提交于 2019-12-04 18:34:09
问题 I am using GWT for my client side application. However, I am not sure how I can handle session management. The GWT application resides on one page, all server calls are done via AJAX. If a session expires on the server. let's assume the user didn't close the browser, and sending some request to server using RPC, how could my server notify the application that the session has expired and that the client side portion should show the login screen again?My sample code : ContactDataServiceAsync

Can Java objects be accessed from Javascript in GWT?

烈酒焚心 提交于 2019-12-04 18:20:40
My goal is to initiate RPC calls directly from javascript. I have come up with ways to fake callbacks (because of the asynchronous nature of RPC) but I can't figure out how to get custom objects into javascript. So, I've created a class named Interop and I statically create the service I'm interested in (had to use static as it was all I could get working, I don't think it's relevant right now): public class Interop { private static final GreetingServiceAsync service = GWT.create(GreetingService.class); ... } I then create a function that will do the async calls and handle the responses:

odoo里的rpc用法

醉酒当歌 提交于 2019-12-04 16:20:53
import odoorpcdb_name = 'test-12'user_name = 'admin'password = 'admin'# Prepare the connection to the serverodoo = odoorpc.ODOO('localhost', port=8069)#服务器地址与端口号odoo.login(db_name, user_name, password) # 数据库名、用户名、密码books_info = odoo.execute('library.book', 'search_read', [['name', 'ilike', 'odoo']], ['name', 'date_release'])print(books_info)OdooRPC是一个Python包,提供了一种通过RPC访问Odoo服务的简便方法 主要功能: 1. 使用类似于服务器端API的API访问所有数据模型方法(甚至是浏览); 2. 使用模型方法命名参数; 3. 自动发送用户上下文,为国际化提供支持 4. 浏览记录; 5. 执行工作流; 6. 管理数据库; 7. 下载报表; 8. JSON-RPC协议(支持SSL) 要使用OdooRPC,首先我们要在服务器上安装OdooRPC服务。 执行命令如下:pip install OdooRPC 支持的Python版本:

JAVA RPC (十) nio服务端解析

不打扰是莪最后的温柔 提交于 2019-12-04 13:32:05
源码地址:https://gitee.com/a1234567891/koalas-rpc 企业生产级百亿日PV高可用可拓展的RPC框架。理论上并发数量接近服务器带宽,客户端采用thrift协议,服务端支持netty和thrift的TThreadedSelectorServer半同步半异步线程模型,支持动态扩容,服务上下线,权重动态,可用性配置,页面流量统计,支持trace跟踪等,天然接入cat支持数据大盘展示等,持续为个人以及中小型公司提供可靠的RPC框架技术方案 ServerSocketChannel简单介绍: 上一篇文章我们讲了netty server服务端的使用方式,对于netty来说对nio层进行了全方位的封装,我们使用netty的使用可以当内部nio是黑盒处理即可,只需要处理netty的hander处理即可,但是koalas-rpc同时也实现了高性能的nio服务框架,给大家另外一种原生的选择,下面我们来简单看一下NIO相关的入门知识。 this.serverSocketChannel = ServerSocketChannel.open(); this.serverSocketChannel.configureBlocking(false); this.serverSocket_ = this.serverSocketChannel.socket(); this

Erlang: How to view output of io:format/2 calls in processes spawned on remote nodes

牧云@^-^@ 提交于 2019-12-04 13:24:28
问题 I am working on a decentralized Erlang application. I am currently working on a single PC and creating multiple nodes by initializing erl with the -sname flag. When I spawn a process using spawn/4 on its home node, I can see output generated by calls io:format/2 within that process in its home erl instance. When I spawn a process remotely by using spawn/4 in combination with register_name , output of io:format/2 is sometimes redirected back to the erl instance where the remote spawn/4 call

Python Remote Procedure Call (Without the Remote Part)

孤街醉人 提交于 2019-12-04 13:24:01
问题 I have a Python server which is not running as root, which fronts an application I am developing. However there are some application features which require access to RAW sockets which means root privileges. Obviously I do not want to run the main server as root, and so my solution is to create a daemon process or command line script which runs as root providing guarded access to said features. However I want put aside stdin/stdout communication and use an RPC style of interaction such as Pyro

RPC(remote procedure call)

旧街凉风 提交于 2019-12-04 12:30:14
分布式系统中, 服务之间的相互调用更加方便, 像调用本地服务一样.(无感远程调用) 实现RPC模型的函数和模块有很多, 只要通过该模型来实现远程调用, 都可称呼为RPC Python中的RPC模型包有gRPC,xmlrpc等 但是, 需要明确的一点, RPC只是实现远程调用的一种思维, 一种模型. 许许多多的模块都会使用RPC思想模型进行构建. RPC的调用步骤为: 发送 另端服务 user调用 ==>> client-stub打包参数 ==>> RPCRun发送... RPCRun接受 ==>> Server-stub 解包 ==>> Server进行调用,处理结果. 接受顺序相反: 客户端 Server得到结果,发送 ==>> ServerStub 打包返回值 ==>> RPCRun发送 ... RPCRun接受 ==>> ClientStub解包 ==>> 传递给User RCP模块的工作内容: 除了中间的RPC部分, 其他和本地调用基本一样: 调用, 然后返回结果. 封装在RPC的服务调用部分工作内容: 在调用别的服务器的时候需要. 打包相关参数, 然后通过RPC发送请求并等待返回. 其他服务的RPC接收到请求,解包运行 打包返回. 每个服务要做的就是, 接受RPC解包分析请求, 然后调用服务返回结果, 最后返回内容前依旧打包. 打包解包: 在流程中,

JAX-WS: why nested elements are in “” namespace?

点点圈 提交于 2019-12-04 12:19:14
问题 Having a toy service as below @WebService(targetNamespace="http://www.example.org/stock") @SOAPBinding(style=Style.RPC,parameterStyle=ParameterStyle.WRAPPED) public class GetStockPrice { @WebMethod(operationName="GetStockPrice",action="urn:GetStockPrice") @WebResult(partName="Price") public Double getPrice( @WebParam(name="StockName") String stock ) { return null; } } JAX-WS-generated client creates a SOAP message where StockName parameter has no namespace: <?xml version='1.0' encoding='UTF-8