311.5. 多部分消息
可从 Camel 2.8.1 开始
ServiceInterfaceStrategy 支持多部分 SOAP 信息。ServiceInterfaceStrategy 必须使用基于 JAX-WS 2.2 的服务接口定义进行初始化,并满足 Document Bare 样式的要求。目标方法必须满足以下条件,根据 JAX-WS 规格:1)它最多有一个 in 或 non-header 参数,2)如果它具有除 in/out void 以外的返回类型,则它必须没有 in/ 或 out out non-header 参数,3)如果它的返回类型为 void 或 non-header 参数。
ServiceInterfaceStrategy 应该使用一个布尔值参数进行初始化,这些参数代表映射策略是否应用到请求参数或响应参数。
ServiceInterfaceStrategy strat = new ServiceInterfaceStrategy(com.example.customerservice.multipart.MultiPartCustomerService.class, true);
SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat("com.example.customerservice.multipart", strat);
ServiceInterfaceStrategy strat = new ServiceInterfaceStrategy(com.example.customerservice.multipart.MultiPartCustomerService.class, true);
SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat("com.example.customerservice.multipart", strat);
311.5.1. 多部分请求 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
多部分请求的有效负载参数使用可反映目标操作的 BeanInvocation 对象进行 initiazlied。在调用 marshal () 处理器时,camel-soap DataFormat 将 BeanInvocation 中的内容映射到 SOAP 标头中的字段,并根据 JAX-WS 映射进行正文。