带有双重ID异常的kSOAP2有点太严格了吗?

时间:2018-07-21 02:05:21

标签: android xml soap ksoap2

kSOAP2拒绝解析我得到的SOAP响应,因为它包含2个具有相同ID值的元素。 关键是在XML模式中,此id为anyURI类型,而不是xs:ID,因此它没有任何唯一性语义: https://github.com/oehf/ipf/blob/8a22c51a47fab1af6fea7da81f9e5d8de636e225/commons/ihe/xds/src/main/resources/wsdl/schema/ebRS30/rim.xsd#L103

是kSOAP2中的错误还是有一种禁用该异常的方法?

1 个答案:

答案 0 :(得分:4)

文档说:

Common base type for all types that have unique identity.     
If id is provided and is not in proper URN syntax then it is used for
linkage within document and is ignored by the registry. In this case the
registry generates a UUID URN for id attribute.
id must not be null when object is retrieved from the registry.

仅仅因为某种东西是架构有效的,并不意味着它满足了应用程序施加的所有约束。我不熟悉此规范,但是对规范施加XML架构之外的约束是完全合理的。在此批注中肯定存在这样的约束条件。