分布式计算中WebService的替代方案: RPC (XML-RPC | JSON-RPC)
XML-RPC
http://zh.wikipedia.org/wiki/XML-RPC
XML-RPC是一个远程过程调用(远端程序呼叫)(remote procedure call,RPC)的分布式计算协议,通过XML将调用函数封装,并使用HTTP协议作为传送机制[1]。
.net中一个比较流行的实现是: xml-rpc.net
http://xml-rpc.net/faq/xmlrpcnetfaq-2-5-0.html
1. Introduction
1.1 What is XML-RPC?
To quote the XML-RPC.com site:
"It's a spec and a set of implementations that allow software running on disparate operating systems, running in different environments to make procedure calls over the Internet. It's remote procedure calling using HTTP as the transport and XML as the encoding. XML-RPC is designed to be as simple as possible, while allowing complex data structures to be transmitted, processed and returned.";
1.2 What is XML-RPC.NET?
XML-RPC.NET is a .NET class library for implementing XML-RPC clients and servers.
1.3 Why use XML-RPC instead of SOAP?
If your clients and servers are all running in the .NET environment there is no point in using XML-RPC: .NET provides excellent support for SOAP and XML-RPC doesn't have any features not provided by SOAP (other than simplicity).
If you use .NET clients and want to connect to XML-RPC servers running under any OS then XML-RPC.NET is a good choice.
If you want to implement a server in the .NET environment which is to be connected to by clients running in other environments, say Unix or Java, then XML-RPC may be an appropriate choice. SOAP is supported in many different environments but is considerably more complicated than XML-RPC and presents more opportunity for interop problems.
1.4 Where do I obtain XML-RPC.NET from?
XML-RPC.NET can be obtained from the XML-RPC.NET home page.
Updates are announced at Cook Computing and the Yahoo XMLRPCNET group.
JSON-RPC
JSON-RPC is a remote procedure call protocol encoded in JSON. It is a very simple protocol (and very similar to XML-RPC), defining only a handful of data types and commands. JSON-RPC allows for notifications (info sent to the server that does not require a response) and for multiple calls to be sent to the server which may be answered out of order.
.net中一个比较流行的实现:
Project Description
JSON-RPC.Net is a high performance Json-Rpc 2.0 server, leveraging the popular JSON.NET library. Host in ASP.NET, also supports sockets and pipes, oh my!
[Dot Net 4.0|Mono] currently Required. ASP.Net is optional.
工具: 监视端口数据
http://www.pocketsoap.com/tcptrace/
listen on port:8081(这个端口号可以自己设定,只要没有被占用就行)。
destination server:loalhost(目标地址,我这里是本地)。
destination port:8080(目标端口,由上面的服务地址决定了这个端口是8080)。
这样配置完成之后,我在浏览器中输入的访问地址中的端口就要变成8081,如:http://localhost:8081/springmvc/handle.do,
因为tcpTrace监听的是8081端口,他会把地址中的8081端口替换成目标端口8080.
分布式计算中WebService的替代方案: RPC (XML-RPC | JSON-RPC)的更多相关文章
- 【.net 深呼吸】聊聊WCF服务返回XML或JSON格式数据
有时候,为了让数据可以“跨国经营”,尤其是HTTP Web有关的东东,会将数据内容以 XML 或 JSON 的格式返回,这样一来,不管客户端平台是四大文明古国,还是处于蒙昧时代的原始部落,都可以使用这 ...
- 使用Boost.PropertyTree处理XML、JSON和INI数据
Boost.PropertyTree 应该是 Boost 1.41.0 开始正式加入 Boost 版本的.目前 ( 2010/02/28 ) 能下到的最新版本是 1.42.0. 主要作用/应用场合 B ...
- 由SOAP说开去 - - 谈谈WebServices、RMI、RPC、SOA、REST、XML、JSON
引子: 关于SOAP其实我一直模模糊糊不太理解,这种模模糊糊的感觉表述起来是这样: 在使用web服务时(功能接口),本来我就可以通过安卓中固有的http类(使用http协议),来发送http请求,并且 ...
- Java中WebService实例
Web Services是由企业公布的完毕其特定商务需求的在线应用服务,其它公司或应用软件可以通过Internet来訪问并使用这项在线服务. Web Service的关键技术和规则: 1.XML:描写 ...
- RPC原来就是Socket——RPC框架到dubbo的服务动态注册,服务路由,负载均衡演化
序:RPC就是使用socket告诉服务端我要调你的哪一个类的哪一个方法然后获得处理的结果.服务注册和路由就是借助第三方存储介质存储服务信息让服务消费者调用.然我们自己动手从0开始写一个rpc功能以及实 ...
- RPC笔记之初探RPC:DIY简单RPC框架
一.什么是RPC RPC(Remote Procedure Call)即远程过程调用,简单的说就是在A机器上去调用B机器上的某个方法,在分布式系统中极其常用. rpc原理其实很简单,比较容易理解,在r ...
- Solon rpc 之 SocketD 协议 - RPC调用模式
Solon rpc 之 SocketD 协议系列 Solon rpc 之 SocketD 协议 - 概述 Solon rpc 之 SocketD 协议 - 消息上报模式 Solon rpc 之 Soc ...
- Solon rpc 之 SocketD 协议 - RPC鉴权模式
Solon rpc 之 SocketD 协议系列 Solon rpc 之 SocketD 协议 - 概述 Solon rpc 之 SocketD 协议 - 消息上报模式 Solon rpc 之 Soc ...
- JAVA RPC(一)RPC入门
为什么要写这个RPC 市面上常见的RPC框架很多,grpc,motan,dubbo等,但是随着越来越多的元素加入,复杂的架构设计等因素似使得这些框架就想spring一样,虽然号称是轻量级,但是用起来却 ...
随机推荐
- jmeter 线程组之间的参数传递
http://www.cnblogs.com/wnfindbug/p/5817277.html 场景测试中,一次登录后做多个接口的操作,然后登录后的uid需要关联传递给其他接口发送请求的时候使用. 1 ...
- Java 反射调用的一种优化
写一些Java框架的时候,经常需要通过反射get或者set某个bean的field,比较普通的做法是获取field后调用java.lang.reflect.Field.get(Object),但每次都 ...
- [BZOJ 2752] 高速公路
Link: BZOJ 2752 传送门 Solution: 虽然有期望,但实际上就是除了个总数…… 此题计算总代价明显还是要使用对每个$w_i$计算贡献的方式: $w_i的贡献为w_i*(i-l+1) ...
- 1.2(java学习笔记)类与对象
对象:是指具体的事物.比如学生 张三,老师 李四,代表一个单一的个体. 比如 学生 张三,这时张三就是具体的对象. 类:将对象中共有特征抽象出,可以理解为某种特性的集合. 世界上的事物可以分解成一 ...
- jquery区分苹果浏览器和安卓浏览器
var browser={ versions:function(){ var u = navigator.userAgent, app = navigator.appVersion; return { ...
- Swift数独游戏优化——C++与OC混编、plist自动生成
一.为什么要C++与OC混编? 在我之前的数独游戏中涉及到的数独游戏生成算法是参考的网上其他人的算法,是利用C++来实现的. 但是在我的例子中我发现这样存在一定的局限性: 1.我是利用Termin ...
- jvm-监控指令-jstack
格式: jstack [option] vmid 选项: -l 除了堆栈信息外,显示关于锁的附加信息. 作用: 生成虚拟机当前时刻的线程快照. 目的: 定位线程长时间停顿的原因,比如线程间死锁.死循环 ...
- 请用心练完这16个webpack小例子
16个demo,webpack+react搭配使用首先教大家2个新技能 1.按照正常github地址情况下,你的github本身不能访问目录. 例如要访问vue-demo下的vueCpu文件夹:htt ...
- 【Echarts】百度Echarts的使用入门+两个简单的小例子+心得
Echarts对于展示结果,有一个很好的表达方式. 1.首先,在官网将js下载到本地,引用到页面上 这里是在开发环境,所以下载最后源代码这个 managerResult.jsp <%@ page ...
- C++之类静态成员变量和静态成员函数
1.静态成员变量必须在类外初始化 2.静态成员变量在类中不占内存字节: 3.静态成员变量,被所有的类对象共 享 class G {public: static int a; //静态成员变量 int ...