xml - SOAP XML 有效 xsi:type
问题描述
我正在尝试编写一个 SOAP 调用,示例请求如下:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://server.opsware.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<ser:attachPolicies soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<self xsi:type="xsd:anyType">?</self>
<policies xsi:type="ser:ArrayOf_xsd_anyType" soapenc:arrayType="xsd:anyType[]"/>
</ser:attachPolicies>
</soapenv:Body>
</soapenv:Envelope>
ArrayOf_xsd_anyType
关于可能意味着什么或我如何找到有效选项的任何想法?
解决方案
只是为了澄清您的术语,您展示的不是 WSDL,而是 SOAP 服务的示例 SOAP 请求。WSDL 是一个 XML 文档,描述了请求和响应中使用的 XML 类型,以及 PortType、Binding 和 Service 信息。
至于anyType
,此链接提供了其用法的清晰概述:
https ://www.ibm.com/support/knowledgecenter/SSFTDH_8.0.0/com.ibm.wbpm.main.doc/topics/cbo_usinganytype.html
但是 TL;DR 是这样的:“anyType 允许任何 DataObject 而不管类型如何。如果 maxOccurs > 1,则列表中的每个 DataObject 都可以[是]不同的类型。”
这与仅限于单一类型的“complexType”形成对比。例如,如果您有一个complexType
数据数组,则所有数组值必须属于同一类型(“客户”、“地址”等)。
推荐阅读
- c++ - QToolButton 上的文本未绘制
- javascript - 从 Vue 中的子组件获取和设置表单值
- firebase - Flutter http post请求到firebase数据库API导致404
- android - Android:如何使用 CameraX 裁剪图像?
- ffmpeg - 如何使用此 ffmpeg 命令行停止为视频添加水印?
- jquery - 使用箭头键导航到图层
- oracle - 在 Oracle 中加入多个 CTE 时遇到重复问题
- swift - 如何关闭模态视图控制器并刷新以前的视图控制器
- ios - UIButton 的 .touchUpInside 事件不起作用
- bioinformatics - 在 Nextflow 中使用 Mutect2 容器时减速