如果架构未指定,则序列中有多少元素?
我有一个正在尝试实现的 WSDL。我的 WSDL 读取工具有一个错误,该错误已在最新版本中得到纠正,因此我重新导入它并重新运行代码生成器,但我遇到了一些问题。
该架构包含某种带有序列声明的类型,如下所示:
<xs:sequence>
<xs:element ref="ns2:Item"/>
</xs:sequence>
原始版本将其转换为单个 Item
。此版本将其转换为 Item
数组。还有一些其他类型包含序列,它们都表示诸如
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:SomeType"/>
“那些被明确解释为数组”之类的内容。但当它没有给出这样的界限时,正确的解释是什么?它是数组还是不是数组?
I've got a WSDL that I'm trying to implement. The WSDL-reading tool I have had a bug in it that got corrected in the latest release, so I've re-imported it and re-run the codegen, and I've got a bit of a problem.
The schema contains a certain type with a sequence declaration that looks like this:
<xs:sequence>
<xs:element ref="ns2:Item"/>
</xs:sequence>
The original version converted that as a single Item
. This version converts it as an array of Item
. There are some other types containing sequences, and they all say stuff like
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:SomeType"/>
Those get unambiguously interpreted as arrays. But when it doesn't give bounds like that, what's the correct interpretation? Is it an array or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
minOccurs
和maxOccurs
的默认值为 1。The default for
minOccurs
andmaxOccurs
is 1.