第 325 章 Spring WebService 组件
从 Camel 版本 2.6 开始提供
Red Hat JBoss Enterprise Application Platform (JBoss EAP)容器 不支持 Camel WebService, camel-spring-ws
, 组件。如果您需要在 JBoss EAP 容器上实施 JAX-WS 端点,建议的方法是使用内置于 JBoss EAP 容器的 webservice
子系统。这种方法可自动为您提供企业级的服务质量(包括管理、安全性等)。如果您随后需要将 JAX-WS 端点与 Camel 路由集成,您可以在初始有效负载处理后将生成的 EndpointImpl
bean 传递给 Camel 路由。
spring-ws: 组件允许您与 Spring Web Services 集成。它支持 客户端- 端支持,用于访问 Web 服务,以及用于创建自己的合同第一 Web 服务的服务器端支持。
Maven 用户需要将以下依赖项添加到此组件的 pom.xml
中:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-ws</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency>
INFO:*Dependencies* As of Camel 2.8 this component included Spring-WS 2.0.x,它(如 Camel 的其余部分)需要 Spring 3.0.x。较早版本的 Camel 版本提供了 Spring-WS 1.5.9,它与 Spring 2.5.x 和 3.0.x 兼容。要在 Spring 2.5.x 上运行 camel-spring-ws
的早期版本,您需要添加 Spring 2.5.x 中的 spring-webmvc
模块。要在 Spring 3.0.x 上运行 Spring-WS 1.5.9,您需要从 Spring 3.0.x 中排除 OXM 模块,因为此模块也包含在 Spring-WS 1.5.9 中(请参阅 此后)
325.1. URI 格式
此组件的 URI 方案如下
spring-ws:[mapping-type:]address[?options]
要公开 Web 服务 映射类型,需要设置为以下任意一种:
映射类型 | 描述 |
---|---|
| 提供根据消息中包含的 root 元素的合格名称来映射 Web 服务请求的选项。 |
| 用于根据消息标题中指定的 SOAP 操作来映射 Web 服务请求。 |
| 要映射以特定 URI 为目标的 Web 服务请求。 |
|
用于根据 XPath |
|
允许您引用 |
作为消费者,地址 应包含与指定 mapping-type 相关的值(例如 SOAP 操作,XPath 表达式)。作为制作者,地址应设置为您调用的 Web 服务的 URI。
您可以使用以下格式在 URI 中附加 查询选项?option=value& amp;option=value&…