safeGetProperty returns "anyType{}"

1,370 views
Skip to first unread message

Henrik L

unread,
Nov 25, 2010, 8:16:03 AM11/25/10
to ksoap2-android
If I'm parsing an XML tag looking like this:

<ns2:Code/>

with the following code:

String code = soapObject.safeGetProperty("Code", "").toString();

the value of code is set to "anyType{}". Any ideas?

Best regards
Henrik

Manfred Moser

unread,
Nov 29, 2010, 5:51:07 PM11/29/10
to ksoap2-...@googlegroups.com
that happens when it is empty. You could change that method to return
null or something else if you like.

manfred

Henrik L

unread,
Nov 30, 2010, 3:17:15 AM11/30/10
to ksoap2-...@googlegroups.com
I think it should return "" since this it what I pass as the second parameter to safeGetProperty. If it returns null I'll get an exception at toString().

2010/11/29 Manfred Moser <mos...@gmail.com>

Manfred Moser

unread,
Nov 30, 2010, 12:20:51 PM11/30/10
to ksoap2-...@googlegroups.com
Sounds good. Do you want to file an issue and potentially even
implement the fix?

Henrik L

unread,
Nov 30, 2010, 12:23:45 PM11/30/10
to ksoap2-...@googlegroups.com
I don't really have the time right now, since I'm working full time in another project. Just wanted to point out the issue for you guys. Later on I might be able to help you out.

Br
Henrik

2010/11/30 Manfred Moser <mos...@gmail.com>

Manfred Moser

unread,
Nov 30, 2010, 12:26:30 PM11/30/10
to ksoap2-...@googlegroups.com
Sure... wanna at least file the issue? I might get around to fix it.

Henrik L

unread,
Nov 30, 2010, 12:27:29 PM11/30/10
to ksoap2-...@googlegroups.com
sure

2010/11/30 Manfred Moser <mos...@gmail.com>

Manfred Moser

unread,
Nov 30, 2010, 12:41:32 PM11/30/10
to ksoap2-...@googlegroups.com
Thanks for filing.

Plasmar T.

unread,
Mar 3, 2014, 6:42:31 PM3/3/14
to ksoap2-...@googlegroups.com
use

String code = soapObject.getPrimitiveProperty("Code").toString();

Malik Haider

unread,
Oct 2, 2016, 1:22:09 PM10/2/16
to ksoap2-android
Use this....

String code = soapObject.getProperty("Code").toString().replace("anyType{}", "");
Reply all
Reply to author
Forward
0 new messages