我想要的肥皂是这样的:
<int:userId>......</int:userId>
这是在 SoapUI 中测试的,因此我得到了正确的响应。Ksoap 做的是这样的:
<userId i:type="n0:undefined" xmlns:n0="http://namespace.com">.....</userId>
如果我将此代码粘贴到 SoapUI 的位置,我会收到错误消息
'<Message>Error in line 5 position 88. Element 'http://namespace.com:
userId'
contains data of the 'http://namespace.com:undefined' data contract.
The deserializer has no knowledge of any type that maps to this contract.
Add the type corresponding to 'undefined' to the list of known types -
for example, by using the KnownTypeAttribute attribute or by
adding it to the list of known types passed to DataContractSerializer.
</Message>
也许我在寻找解决方案的错误方向,但我现在在问如何让 ksoap 省略该i:type
部分。如果有人可以提供不同的解决方案,我将不胜感激。