<ListingsChannel SourceId="873" Channel="4" ServiceType="Analog> <…..></ListingsChannel>
i can get the elements with the KvmSerializable, but i can't get the attributes, such as SourceId, Channle.
which api/function should i used? thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<ListingsChannel SourceId="873" Channel="4" ServiceType="Analog> <Name>Hillcreste - Time Warner</Name></ListingsChannel>
Thanks for your help, when i use the SoapObject to access the attributes, but i can't get the right elements, for example, the "Name" element which type is a string, because readSerializable api wouldn't call the obj.getPropertyInfo(testIndex, properties, info); so it can't get the rigth type and will go to the readUnknown module.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<ListingsChannel SourceId="873" Channel="4" ServiceType="Analog> <…..></ListingsChannel>
i can get the elements with the KvmSerializable, but i can't get the attributes, such as SourceId, Channle.
which api/function should i used? thanks!
SoapObject has methods to access the attributes. It however seems to be broken and we added a fix in the ksoap2-android project for that.
ok, i will try it, thanks!
Hi mosabua,
<ListingsChannel SourceId="873" Channel="4" ServiceType="Analog> <Name>Hillcreste - Time Warner</Name></ListingsChannel>
Thanks for your help, when i use the SoapObject to access the attributes, but i can't get the right elements, for example, the "Name" element which type is a string, because readSerializable api wouldn't call the obj.getPropertyInfo(testIndex, properties, info); so it can't get the rigth type and will go to the readUnknown module.
what version of ksoap2-android are you using now and how are you parsing the response?
i use the ksoap2-android-assembly-2.5.6-jar-with-dependencies.jar. version is 2.5.6
if (!implicitTypes || !(obj instanceof SoapObject))
{
obj.getPropertyInfo(testIndex, properties, info);
obj.setProperty(testIndex, read(parser, obj, testIndex, null, null, info));
}
else
{
((SoapObject) obj).addProperty(parser.getName(), read(parser, obj, obj.getPropertyCount(), ((SoapObject) obj).getNamespace(), name, PropertyInfo.OBJECT_TYPE));
}
because i used the SoapObject, so it will go to the else section codes.