在 xs:any 中解析时 xsi:nil 验证失败
我有一个模式,其中包含(例如)...
<xsd:complexType name="mytype">
<xsd:sequence>
<xsd:any maxOccurs="unbounded" processContents="skip"/>
</xsd:sequence>
</xsd:complexType>
...以及一些包含此元素的 XML...
<MYELEMENT xmlns = "http://www.mynamespace.co.uk/types" xsi:nil = "true"/>
...我有一个 SOAP 调用,需要返回“mytype”。当我返回包含上述内容的 XML 时,出现以下错误:
由以下原因引起:org.xml.sax.SAXException:验证错误:#cvc-elt.3.1 元素“{http://www.mynamespace.co.uk/types}MYELMENT”不可为空。 ({com.tibco.xml.validation}COMPLEX_E_ELEMENT_NOT_NILLABLE)
这是在 TIBCO 5.5 设计器中执行的 SOAP 调用。我了解 TIBCO 并不是世界上最知名的工具;我真正想从这个问题中得到的是错误是否是预期的行为(可能是因为该元素具有定义的名称空间???)。
我本以为 processContents="skip"
应该允许任何内容通过?
只是为了完成信息,命名空间 http://www.mynamespace.co.uk/types 是可供 SOAP 接收者使用。无论架构中是否定义了“MYELMENT”,无论是否有 nillable="true"
,我都会收到此错误。我从客户处收到 XML,因此无法从 MYELMENT 中删除 xsi:nil = "true"。
I have a schema containing (for example)...
<xsd:complexType name="mytype">
<xsd:sequence>
<xsd:any maxOccurs="unbounded" processContents="skip"/>
</xsd:sequence>
</xsd:complexType>
... and some XML containing this element...
<MYELEMENT xmlns = "http://www.mynamespace.co.uk/types" xsi:nil = "true"/>
... I have a SOAP call that expects back 'mytype'. When I get back XML containing the above, I get the following error:
caused by: org.xml.sax.SAXException: validation error: #cvc-elt.3.1 Element "{http://www.mynamespace.co.uk/types}MYELEMENT" is not nillable. ({com.tibco.xml.validation}COMPLEX_E_ELEMENT_NOT_NILLABLE)
This is a SOAP call performed within TIBCO 5.5 designer. I understand that TIBCO is not the most known tool in the world; what I really want to get out of this question is whether the error is expected behavior (maybe because the element has a defined namespace???) or not.
I would have thought that the processContents="skip"
should allow anything through?
Just to complete the info, namespace http://www.mynamespace.co.uk/types is available to the SOAP receiver. I get this error regardless of whether 'MYELEMENT' is defined in the schema or not, with or without nillable="true"
. I am receiving the XML from a customer and therefore cannot remove the xsi:nil = "true" from MYELEMENT.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现这是 TIBCO Designer 5.5 的一个错误。使用 5.6 或更高版本。
I've found that its a TIBCO Designer 5.5 bug. Use 5.6 or higher.