complexType 是否允许作为属性内容?
Is complexType allowed as attribute content?
我有一个来自客户端的 WSDL/XSD 并尝试使用 wsimport 导入,它抱怨:
[ERROR] Unexpected <complexType> appears at line 508 column 33
我检查了文件,它显示:
<complexType name="ActionInfo">
<sequence/>
<attribute name="action">
<complexType name="string">
<simpleContent>
<extension/>
</simpleContent>
</complexType>
</attribute>
<attribute name="type">
<complexType name="string">
<simpleContent>
<extension/>
</simpleContent>
</complexType>
</attribute>
</complexType>
这合法吗?显然这是 xsd 我从他们的生产环境中得到的,所以它对他们有用。
在他们的 WSDL 的顶部,它说它是由 Axis 1.4 生成的
绝对不会。
属性就其本质而言不能具有复杂的内容。错误消息完全正确: xs:attribute
must be a simple type.
的类型定义
另见 XML attribute vs XML element
我有一个来自客户端的 WSDL/XSD 并尝试使用 wsimport 导入,它抱怨:
[ERROR] Unexpected <complexType> appears at line 508 column 33
我检查了文件,它显示:
<complexType name="ActionInfo">
<sequence/>
<attribute name="action">
<complexType name="string">
<simpleContent>
<extension/>
</simpleContent>
</complexType>
</attribute>
<attribute name="type">
<complexType name="string">
<simpleContent>
<extension/>
</simpleContent>
</complexType>
</attribute>
</complexType>
这合法吗?显然这是 xsd 我从他们的生产环境中得到的,所以它对他们有用。
在他们的 WSDL 的顶部,它说它是由 Axis 1.4 生成的
绝对不会。
属性就其本质而言不能具有复杂的内容。错误消息完全正确: xs:attribute
must be a simple type.
另见 XML attribute vs XML element