SOAP 属性总是以相同的顺序出现吗?
我正在使用 ksoap2 访问 Azure 服务,并且需要从相当复杂的对象中获取属性。它看起来有点像
<a:top xmlns:a="http://anamespace.org/" xmlns:b="http://bnamespace.org">
<b:middle>
<b:bottom>value</b:bottom>
<b:derriere>value2</b:derriere>
</b:middle>
<b:muddle>other</b:muddle>
</a:top>
现在我想按名称获取属性,但是 SoapObject.getProperty(String) 似乎不允许您指定名称空间。子元素具有与顶部元素不同的命名空间。另一方面,声明 KVMSerialized
对象似乎假定属性可以按索引并按顺序放入对象中。然而,我对 XML 的经验表明这
<a:top xmlns:a="http://anamespace.org/" xmlns:b="http://bnamespace.org">
<b:muddle>other</b:muddle>
<b:middle>
<b:bottom>value</b:bottom>
<b:derriere>value2</b:derriere>
</b:middle>
</a:top>
通常同样有效。这对于 SOAP 来说是不正确的吗? SOAP 元素是否总是仅以一种顺序出现,并且可以完全依赖这一点吗?
I am using ksoap2 to access an Azure service and I need to get properties out of a fairly complex object. It looks a bit like
<a:top xmlns:a="http://anamespace.org/" xmlns:b="http://bnamespace.org">
<b:middle>
<b:bottom>value</b:bottom>
<b:derriere>value2</b:derriere>
</b:middle>
<b:muddle>other</b:muddle>
</a:top>
Now I want to get the properties by name, but SoapObject.getProperty(String)
doesn't seem to let you specify a namespace. The sub-elements have a different namespace from the top element. On the other hand, declaring a KVMSerializable
object seems to assume that properties can be put into the object by index and in order. However, my experience of XML suggests that
<a:top xmlns:a="http://anamespace.org/" xmlns:b="http://bnamespace.org">
<b:muddle>other</b:muddle>
<b:middle>
<b:bottom>value</b:bottom>
<b:derriere>value2</b:derriere>
</b:middle>
</a:top>
is usually just as valid. Is this untrue for SOAP? Do SOAP elements always occur in only one order, and can this be relied upon completely?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
随着 ksoap2-android 的最新 2.6.1 版本的发布,我昨天削减的订购变得很重要。一探究竟。
With the latest 2.6.1 release of ksoap2-android I cut yesterday ordering becomes significant. Check it out.