远程过程调用和 Web 服务之间的区别是什么?

RPC 和 Web 服务有什么明确的定义吗:

远程过程调用(RPC)是一个 行程间通讯技术 允许计算机程序 使子程序或过程 在另一个地址空间执行 (通常在另一台计算机上) 共享网络) 显式地为此编写详细代码 远程互动。

Web 服务: Web 服务是 典型的应用程序编程 接口(API)或 web API 通过超文本传输访问 协议并在远程上执行 托管请求服务的系统。 Web 服务往往属于 两个阵营: 大型网络服务[1]和 RESTful Web 服务。

我不太清楚这两件事情之间的真正区别。似乎有一样东西可以同时属于 RPC 和 Web 服务。

Web 服务是 RPC 的更高层次的表示吗?

55173 次浏览

Is Web Service a higher level representation of RPC?

Yes, it is. A web service is a specific implementation of RPC. At its lowest level, Web Service connects to the Socket, using the HTTP protocol, to negotiate sending a payload that is executed in a remote space (remote space can be the same computer). All these remote call abstractions, at its core, are RPCs.

• Data is formatted for transfer using XML, improving or eliminating marshalling, unmarshalling, and various other translation-related requirements normally coded by a developer. • Data is passed using standardized protocols such as HTTP or SMTP, which have published well-defined standards. • The underlying exposed service is well-defined using a known accepted mechanism, WSDL. • Services are found using a well-defined standard, UDDI, and the more advanced ebXML.

Specifically WSDL provides a number of key pieces of information:

• A definition of the format of the messages that are passed between two endpoints using its and elements and appropriate schema definitions. • The semantics of the service: how it might be called to make a synchronous request/reply, synchronous reply-only or asynchronously communicate. • The end point and transport of the service via the element: that is, who provides the service. • An encoding via the element, that is how the service is accessed.

Remote Procedure Call (RPC) and WebService, in the sake of Functionality both go parallely. But there is a subtle difference in their way of invoking. An Web Service can be invoked by any application, using XML format over HTTP protocol for proceedings and its interoperable in nature, whereas in case of RPC the function can be Invoked by multi applications so it follow the path of Serialization to store the object data. It supports Binary Format over TCP protocol. In a better approach we can brief RPC workflow, like we are executing a function through proper Socket and proper format of message, but don't know the actual existence of the particular function in client server.Even the provided socket might not be in the same server in which the function resides. But every time it give a feel like the function is located in the local. In Remote Service, the Function resides in remote machine and it can be invoked by proper format and Protocol and it allows Scalability.

I see this question. The question has been asked long time ago, but I think anyone's answer in this community, giving more information and clarity on this topic, will be helpful for the future questioners. So, I would like to add my enhancement pointing out key differences and I hope, it will be helpful for future readers.

------------------------------------------------------------------------------
| Category             |    RPC              |    Web Services
------------------------------------------------------------------------------
|Operation's Location  | On top of TCP       | on top of HTTP Protocol
------------------------------------------------------------------------------
|Data format           | Binary              | Text, XML, JSON, ect.
------------------------------------------------------------------------------
|Speed                 | Slow (Marshalling)  | Fast
------------------------------------------------------------------------------

I have not mentioned descriptions of RPC and Web Services, because you see them in others' answer clearly.