# 15.3　使用 Hessian 和 Burlap 发布远程服务

Hessian 和 Burlap 是 Caucho Technology 提供的两种基于 HTTP 的轻量级远程服务解决方案。借助于尽可能简单的 API 和通信协议，它们都致力于简化 Web 服务。

你可能会好奇，为什么 Caucho 对同一个问题会有两种解决方案。Hessian 和 Burlap 就如同一个事物的两面，但是每一个解决方案都服务于略微不同的目的。

Hessian，像 RMI 一样，使用二进制消息进行客户端和服务端的交互。但与其他二进制远程调用技术（例如 RMI）不同的是，它的二进制消息可以移植到其他非 Java 的语言中，包括 PHP、Python、C++ 和 C#。

Burlap 是一种基于 XML 的远程调用技术，这使得它可以自然而然地移植到任何能够解析 XML 的语言上。正因为它基于 XML，所以相比起 Hessian 的二进制格式而言，Burlap 可读性更强。但是和其他基于 XML 的远程技术（例如 SOAP 或 XML-RPC）不同，Burlap 的消息结构尽可能的简单，不需要额外的外部定义语言（例如 WSDL 或 IDL）。

你可能想知道如何在 Hessian 和 Burlap 之间做出选择。很大程度上，它们是一样的。唯一的区别在于 Hessian 的消息是二进制的，而 Burlap 的消息是 XML。由于 Hessian 的消息是二进制的，所以它在带宽上更具优势。但是如果我们更注重可读性（如出于调试的目的）或者我们的应用需要与没有 Hessian 实现的语言交互，那么 Burlap 的 XML 消息会是更好的选择。

为了在 Spring 中演示 Hessian 和 Burlap 服务，让我们回顾一下在前一节中使用 RMI 解决 Spitter 服务的示例。但是这一次，我们将看看如何使用 Hessian 和 Burlap 作为远程调用模型来解决这个问题。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://potoyang.gitbook.io/spring-in-action-v4/untitled-9/untitled-3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
