swami-manickam / android-xmlrpc

Automatically exported from code.google.com/p/android-xmlrpc
0 stars 0 forks source link

Unable to parse string when it is an empty string #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a method returning an empty string, using Apache XML-RPC server & 
TomCat
2. Call on android.
3. Bug surfaces

What is the expected output? What do you see instead?
Empty string should be retrieved successfully. However due to the fact that 
Apache XML-RPC uses the shorthand tag "<value />" for "<value></value>, 
parsing will fail

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
        <value />
    </param>
  </params>
</methodResponse>

What version of the product are you using? On what operating system?
Latest SVN on Windows Vista Home Premium (64bit)

Please provide any additional information below.

Original issue reported on code.google.com by slash.ak...@gmail.com on 16 Apr 2009 at 4:50

GoogleCodeExporter commented 8 years ago
I got the issue when returning Map object with empty value.

1. Create a method returning Map object and set a key("key") and empty 
value("").
2. Call on android.

org.xmlrpc.android.XMLRPCException: java.io.IOException: Cannot deserialize 
value

It worked with non-empty value.

Original comment by hideki.y...@gmail.com on 15 Jul 2009 at 3:42

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Is there already a solution? 

Original comment by woutergo71 on 3 Sep 2009 at 6:11

GoogleCodeExporter commented 8 years ago
Please can you fix this!

Original comment by woutergo71 on 9 Sep 2009 at 4:23

GoogleCodeExporter commented 8 years ago
This is not fix and just temporary solution.
Since my Map values are all strings so it will set empty string when it failed 
to parse. 

if (name.equals(TAG_VALUE)) {
// work around for empty string for map value
  try{
    memberValue = deserialize(parser);
  }catch(Exception e){
    //Logging.e(this, e);
    Logging.e(this, "Work around for empty string in map");
    memberValue = "";
  }
}

Original comment by hideki.y...@gmail.com on 10 Sep 2009 at 2:34

Attachments:

GoogleCodeExporter commented 8 years ago
Issue #19 deals with "Support for <nil/> value extension to the XML-RPC spec" - 
I think this may be the same issue. Can someone check out the latest version of 
the code from the repo and see whether this fixes this issue too?

Original comment by jon@sprig.gs on 24 Nov 2010 at 9:55