30.6. 消息标头
CXF-RS 组件支持 16 个消息标头,如下是/are:
| Name | 描述 | 默认值 | 类型 |
|---|---|---|---|
| operationName (common) constant: OPERATION_NAME | 操作的名称。 | 字符串 | |
| CamelAuthentication (common) 常数: AUTHENTICATION | 身份验证。 | 主题 | |
| CamelHttpMethod (common) 常数: HTTP_METHOD | 要使用的 http 方法。 | 字符串 | |
| CamelHttpPath (common) 常数: HTTP_PATH | http 路径。 | 字符串 | |
| Content-Type (common) 常数: CONTENT_TYPE | 内容类型。 | 字符串 | |
| CamelHttpQuery (common) 常数: HTTP_QUERY | http 查询。 | 字符串 | |
| CamelHttpResponseCode (common) | http 响应代码。 | 整数 | |
| content-Encoding (common) 常量: CONTENT_ENCODING | 内容编码。 | 字符串 | |
| org.apache.cxf.message.Message.PROTOCOL_HEADERS (common) 恒定: PROTOCOL_HEADERS | 协议标头。 | Map | |
| CamelCxfMessage (common) | CXF 消息。 | 消息 | |
| CamelCxfRsUsingHttpAPI (common) | 如果为 true,CxfRsProducer 将使用 HttpClientAPI 调用该服务。如果是 false,CxfRsProducer 将使用 ProxyClientAPI 调用该服务。 | 布尔值 | |
| CamelCxfRsVarValues (common) | 路径值。 | Object[] | |
| CamelCxfRsResponseClass (common) | 响应类。 | 类 | |
| CamelCxfRsResponseGenericType (common) | 响应通用类型。 | 类型 | |
| CamelCxfRsQueryMap (common) | 查询映射。 | Map | |
| CamelCxfRsOperationResourceInfoStack (common) | 当 JAX-RS 调用查找 target 时,MethodInvocationInfo 堆栈代表资源路径。 | OperationResourceInfoStack |
您还可以通过 spring 配置配置 CXF REST 端点。
使用 cxf-rt-transports-jetty, cxf-rt-transports-jetty ,cxf-rt-transports-netty-server,cxf-rt-transports-undertow 库在 Camel Spring Boot 应用程序中创建您自己的 HTTP 服务器实例。建议您使用 Spring Boot 嵌入式 HTTP 服务器堆栈,该堆栈在使用 spring-boot-starter-web,cxf-spring-boot-starter-jaxrs, 或 cxf-spring-boot-starter-jaxws 依赖项时创建的。
由于 CXF REST 客户端和 CXF REST 服务器之间存在许多差异,因此我们为它们提供不同的配置。
+ 请检查以下文件以了解更多详情: