Chapter 2: Introduction to RPC
This chapter provides an overview of the Remote Procedure Call (RPC) model. For more information refer to your DCE publications.
2.1 Overview
A Remote Procedure Call is a mechanism which enables you to set up communication between the client and the server in a distributed application without involving you in the details of network communication. An essential part of the RPC mechanism is the definition of the interface between the client and the server. This is contained in an interface definition file . A remote procedure call in client source code is similar to a local procedure call, the difference being that the communication with the remote procedure is through DCE over the network.
2.2 Operation
An RPC distributed application is basically divided into two parts, the client side and the server side. The client side runs on one node and makes requests for services on behalf of the user. The server side runs on another node and services the client's requests. It can offer many remote procedures to an application.
2.2.1 RPC Interfaces and Stubs
The DCE RPC requires an interface definition which is used to generate the RPC stub files. These provide the actual DCE RPC support, as shown in Figure 2-1.
*
Figure 2-1: RPC Interface Structure
The interface definition describes the interface procedures and their associated parameters. Each version of an interface must be exactly the same for all implementations of that interface. As such, various clients from separate applications can call the same interface from remote locations.
Generated RPC stub files perform basic communication functions for remote procedure calls. They use RPC facilities to find servers for clients and send and receive remote procedure calls. They also perform data conversions if necessary and handle the transfer of data between clients and servers.
When a remote procedure call is made from the client application code the call is actually made to the client stub. The client stub converts the call information into internal RPC format and passes the call, with the necessary information to find a server, to the client RPC run-time library which transmits it to the server system across the network. The server RPC run-time library receives the call and passes it to the server stub which converts the information from RPC format to application format.
Then the server stub passes the call to the server where it is executed, and the whole conversion process is reversed as the call response is returned to the client. Figure 2-2 shows the sequence of a remote procedure call.
*
Figure 2-2: Sequence of a Remote Procedure Call
2.2.2 Binding Methods
The relationship between a client process and a server process during a remote procedure call is called binding. Binding information tells a client how to find a particular server. It includes the following:
* A protocol sequence
* The server host
* The endpoint
A binding handle refers to the binding information for one binding process.
Binding information for DCE applications is usually stored on a name service database. The Cell Directory Service (CDS) is a name service particular to DCE. The RPC run-time library holds name service routines which are used to access the CDS.
There are three different possible binding methods:
* Automatic
* Implicit
* Explicit
These are described in the following sections.
2.2.2.1 Automatic Binding
When automatic binding is selected the client stub automatically manages bindings when a remote procedure call is made from an application. The client stub gets the binding handle from the name service database and passes it to the RPC run-time library. This is the most transparent form of binding and requires minimal changes to a client application.
2.2.2.2 Implicit Binding
When implicit binding is selected a binding handle is held in a global area of the client stub. When a remote procedure call is made from an application the stub passes the binding handle to the RPC run-time library. You must write application code to obtain the binding information and set the global binding handle with RPC run-time routine calls.
2.2.2.3 Explicit Binding
When explicit binding is selected a binding handle is passed explicitly as the first parameter when a remote procedure call is made from an application. You must write application code to obtain the binding information and set the binding handle with RPC run-time routine calls.
2.2.3 Micro Focus COBOL Support for DCE RPC
To define a DCE RPC interface an interface definition must be written using the IDL (Interface Definition Language). Currently the DCE IDL definition can only be used to define an RPC interface for C applications. To enable a DCE RPC interface to be defined for COBOL applications Micro Focus DCE support for COBOL applications provides COBOL IDL.
Once a DCE RPC interface has been defined the next step is the generation of stubs and files that provide the actual support for the defined RPC calls. For DCE C applications this is done by using the DCE IDL compiler which uses the DCE IDL definition as input. To provide similar support for COBOL IDL Micro Focus provides the COBIDL utility. This utility takes the COBOL IDL definition as input and generates COBOL copyfiles (instead of C header files) and stubs that provide the actual support for the defined RPC calls. These stubs can be linked to the COBOL application code.
For more information on the COBOL IDL utility COBIDL see the chapters, Introduction to COBOL IDL and COBOL DCE Application Development Using COBIDL.
Micro Focus also provides a utility, COBDAG, that enables the automatic generation of DCE RPC support for native COBOL applications. The only input required is the actual source code of the COBOL application. It generates an executable COBOL/DCE server and client as its output.
For more information on the COBDAG utility see the chapters, Introduction to COBDAG and COBOL DCE Application Development Using COBDAG.
Copyright © 1996 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
link:http://www.docs.hp.com/en/64/ll/llrpci.htm
分享到:
相关推荐
- **在线资源**:DevCentral网站提供了关于DCOM的详细介绍和示例代码下载,访问地址为:[DevCentral-Introduction to DCOM](http://devcentral.iticentral.com)。 - **社区论坛**:可以通过参与DevCentral社区的讨论...
- **远程过程调用(RPC)中间件**:提供了一种在不同计算机之间调用函数或过程的方法。 - **对象请求代理(ORB)**:实现对象之间的通信,是面向对象分布式计算环境的核心。 ### Web服务(Web Services) Web服务...
通过引入中间人——消息队列,我们可以避免同步远程过程调用(RPC)所带来的问题,如服务器不可用、响应延迟或请求过多。 **RabbitMQ 简介** RabbitMQ 是一个跨平台、跨语言的消息代理,它支持多种编程语言,包括 ...
11. 面向对象编程介绍(Introduction to Classes and Object-Oriented Programming):面向对象编程是软件开发中一个核心范式,这部分内容会介绍如何在Laszlo中使用类和面向对象的概念来构建应用程序。 12. 布局和...
Poland Introduction to Microsoft RPC Reverse engineering of Microsoft RPC services dmidl (reverse midl) fa (reverse c) Exploitation techniques for RPC vulnerabilities RPC DCOM ...
提供的压缩包文件"Introduction-to-RPC-Part-1.pdf"很可能是对RPC概念的详细文档,包括其历史、设计原则和实际应用案例。而"rpcintro1_demo_v2.zip"和"rpcintro1_src_v2.zip"可能包含了上述介绍的示例程序的源代码和...
Introduction Chapter 2. RPC Mechanisms Chapter 3. The RESTful API Service Chapter 4. Junos PyEZ Chapter 5. Commit Scripts Chapter 6. Op Scripts Chapter 7. Event Scripts and Event Policies Chapter 8. ...
#### Introduction to GWT **Google Web Toolkit (GWT)** is a powerful development framework that enables developers to build highly interactive web applications. It provides a comprehensive set of tools...
Topics include: Introduction to async development; HTTP and real-time communications; SignalR technology fundamentals; persistent connections and hubs; multiplatform real-time applications; advanced ...
Chapter 1: Introduction to Client-Server Networking Chapter 2: UDP Chapter 3: TCP Chapter 4: Socket Names and DNS Chapter 5: Network Data and Network Errors Chapter 6: TLS/SSL Chapter 7: ...
lmost ten years ago, my introduction to the commercial world was handling and dealing with the databases of a UK government body. We used a free text-retrieval system to store information about ...
The chapter starts with an introduction to SOAP, the most complex of the web service protocols. SOAP relies heavily on other standards like WSDL and XSD, which are also covered in readable detail. ...
RO00 - Article ROadmap for the... ...RO42 - Introduction to Free Pascal... RO45 - How to Write a RemObjects SDK... RO46 - How to Write a RemObjects SDK... WP02 - Cross Platform Development with...
1.1 introduction 3 1.2 processes, threads, and the sharing of information 5 1.3 persistence of ipc objects 6 1.4 name spaces 7 1.5 effect of fork, exec, and exit on ipc objects 9 1.6 error ...
How to Contact Us Safari® Enabled Acknowledgments Chapter 1. Text Introduction Recipe 1.1. Processing a String One Character at a Time Recipe 1.2. Converting Between Characters and ...
The Way to Go,: A Thorough Introduction to the Go Programming Language 英文书籍,已Cross the wall,从Google获得书中源代码,分享一下。喜欢请购买正版。 目录如下: Contents Preface......................