第 65 章 Spring WebService
从 Camel 2.6 开始
支持生成者和消费者
Spring WS 组件允许您与 Spring Web Services 集成。它为访问 Web 服务以及创建您自己的合同第一 Web 服务提供客户端 - 端支持。
Maven 用户必须在其 pom.xml
中为这个组件添加以下依赖项:
<dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-spring-ws-starter</artifactId> </dependency>
使用 BOM 获取版本。
<dependencyManagement> <dependencies> <dependency> <groupId>com.redhat.camel.springboot.platform</groupId> <artifactId>camel-spring-boot-bom</artifactId> <version>${camel-spring-boot-version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
65.1. URI 格式
此组件的 URI 方案如下
spring-ws:[mapping-type:]address[?options]
要公开 Web 服务 映射类型,需要设置为以下任意一种:
映射类型 | 描述 |
---|---|
| 提供根据消息中包含的 root 元素的合格名称来映射 Web 服务请求的选项。 |
| 用于根据消息标题中指定的 SOAP 操作来映射 Web 服务请求。 |
| 要映射以特定 URI 为目标的 Web 服务请求。 |
|
用于根据 XPath |
|
允许您引用 |
作为消费者,地址 应包含与指定 mapping-type 相关的值(例如 SOAP 操作,XPath 表达式)。作为制作者,地址应设置为您调用的 Web 服务的 URI。