为何Web Service被称为中间件?Axis2归类为中间件的疑问
Great question—your confusion makes total sense, because Axis2 doesn’t look like the multi-functional middleware you worked with in your Java/RMI three-tier architecture. Let’s unpack this by expanding how we define middleware and where Axis2 fits in:
1. Middleware isn't limited to handling business logic
First, let’s revisit the Wikipedia definition you cited:
可被视为中间件的服务包括企业应用集成、数据集成、面向消息的中间件(MOM)、对象请求代理(ORBs)和企业服务总线(ESB)。
Notice that Object Request Brokers (ORBs) are included here—and they’re a perfect parallel to Axis2. ORBs exist solely to enable communication and interoperability between distributed components, not to run business logic. The core purpose of middleware is to bridge gaps between different parts of a system—whether that’s integrating business data, handling security, or simply making it possible for disparate components to talk to each other. Your old middleware was a "jack-of-all-trades" type (handling data integration, presentation, security), but that’s just one flavor of middleware, not the whole definition.
2. Axis2 fills the role of a "communication middleware"
When you migrated your RMI-based system to Axis2, you converted all POJOs to web services, and Axis2 only handled SOAP/REST communication. But this communication abstraction is exactly what makes it middleware:
- It removes the tight coupling of RMI (which only works between Java components) and replaces it with standard, cross-platform protocols (SOAP/REST), enabling interoperability with non-Java systems.
- It takes care of low-level communication details: service publishing, endpoint addressing, message encoding/decoding, and request/response routing. These are generic, reusable services that sit between your application logic and the network—classic middleware territory.
Compare this to RMI: You’re right that RMI isn’t typically considered middleware because it’s a Java-specific API tied to the JVM, not a general-purpose communication layer. Axis2, as a JAX-WS implementation, is a standardized, language-agnostic intermediary—this is the key distinction.
3. The paper's classification comes down to architectural layering
When the paper calls Axis2 middleware, it’s looking at the system’s layered architecture: Axis2 sits between your client application and backend services (your two managers and existing middleware component), acting as a dedicated intermediary for communication. In the broadest sense, middleware is any software that sits between operating systems and application code to provide common services—and Axis2 fits this perfectly.
Your original middleware was a "business-focused" middle layer, while Axis2 is a "communication-focused" middle layer. Both are valid types of middleware—they just solve different problems in the distributed system.
内容的提问来源于stack exchange,提问作者overexchange

