Lesson 4: Expose the RPC adapter service
Procedure
What to do next
http://localhost:<port>/MyMovieProject/RPCAdapter/httprpc/
The browser shows the exposed services as a table:

Web-remoting is a pattern that provides support for JavaScript or client-side code to directly start server-side logic. Using this pattern, you can start Java™ methods from JavaScript. The invocation is performed with a JSON-RPC call. The most common usage is asynchronous calls with XmlHttpRequest. Data is transferred between the server and client in JavaScript Object Notation (JSON) format. Therefore, this pattern is essentially a form of JSON web services.
The IBM® implementation for web-remoting is known as the Remote Procedure Call (RPC) adapter for IBM. The RPC adapter is designed to help developers quickly create command-based services in a manner that complements programming styles for Ajax applications and other lightweight clients. Implemented as a generic servlet, the RPC adapter provides an HTTP interface to registered JavaBeans.

The RPC adapter provides an HTTP interface to registered JavaBeans. It deserializes the input and calls the corresponding method in the JavaBeans. It serializes the output from the JavaBeans to JSON/XML format.
- HTTP RPC, which encodes RPC invocations as URLs with query parameters, for HTTP GET, or form parameters, for HTTP POST.
- JSON-RPC, supports the SMD service descriptor employed by the Dojo dojo.rpc.JsonService API.
The Remote Procedure Call (RPC) adapter provides a mechanism for exposing server-side Java objects to AJAX-based user interfaces.
Lesson checkpoint
- How to use the Page Data view to expose the RPC adapter service.
- How the RPC adapter exposes server-side Java objects to AJAX-based user interfaces.



