soap - 使用 Spring Web 服务针对 WSDL 验证 SOAP 消息
问题描述
使用 Spring Web 服务是否可以根据 WSDL 的 types 元素中定义的模式来验证 soap 消息?
背景:给定第三方 WSDL,其架构直接在 types 元素中定义
<definitions>
<types>
<xsd:schema>
<xsd:element name="messageBody">
...
</xsd:element>
</xsd:schema>
</types>
...
</definitions>
我需要生成一个 SOAP Web 服务来验证针对这个嵌入式模式的请求消息。
spring 文档 ( https://docs.spring.io/spring-ws/docs/3.0.10.RELEASE/reference/ ) 建议使用 PayloadValidatingInterceptor 进行验证。然而,这个拦截器似乎只适用于 XSD 文档。
我考虑过手动或以编程方式从 WSDL 中提取模式,然后使用提取的 xsd 文档配置 payloadVaidatingInterceptor。然而,这两者都有其缺点。
理想情况下,我想直接使用 WSDL。例如:
payloadValidatingInterceptor.setXsdSchema("service.wsdl");
其他 Web 服务框架(例如 CXF)能够做到这一点。Spring Web 服务是否能够针对 WSDL 模式进行验证?或者这是框架的限制?
解决方案
推荐阅读
- reactjs - 如何在 Django 和 React 中跟踪匿名会话
- python - 对dict值的懒惰评估?
- python - Dataloader 对象不绘制绘图的问题
- typescript - 如何在“onChange”事件中获取 office-ui-fabric-react Dropdown 的 ID?
- javascript - 忽略数组中的元素值时获取最小索引
- javascript - 按数据属性过滤 DataTable.js 行
- pdf - Ghostscript OCR 和输出文件
- python-3.x - 在 QGraphicsPixmapItem 中打开上下文菜单时,如何删除此 QGraphicsLineItem?
- swift - 快速更改多个后续变量
- c# - Parallel.ForEach 搜索找不到正确的值