Book Image

SPRING COOKBOOK

Book Image

SPRING COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Spring Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


This chapter is about making Spring interact with another piece of software over a network. Different protocols can be used for this, but each one of them uses a client/server architecture. Spring can be the client or server.

Java RMI and HTTP Invoker are remote method invocation technologies; a Java client executes a method located on a Java server just as with a normal method. The request contains the method's arguments and the response contains the method's return value.

Hessian, REST, and SOAP are web services; the request is an HTTP request to a web server, which sends back an HTTP response. Web services are platform agnostic; for example, the client could be a Spring application (Java) and the server could be a PHP application.

REST is currently the most popular option; it's simple, flexible, and cross-platform.

As a rule of thumb, use:

  • HTTP Invoker to interact with another Spring application

  • Java RMI to interact with another Java application not using Spring

  • Hessian to interact...