views:

460

answers:

2

A REST XML (not JSON!) Web Service should exchange XML Schema specified XML between a Google App Engine and an Android app.

I wanted to use XStream for both, however, I could not get it to work for the Google App Engine, therefore to me Apache XMLBeans is the next best choice (JAXB does not work on both). However, with Google App Engine there is no problem, but on Android, I get several severe exceptions (eg. due to the usage of the Stax API with its javax.xml.* packages).

So,

  1. Is there any other XML-binding possibility to stream XML documents on GAE and Android?
  2. If not, is it possible to patch Apache XMLBeans to work with Android?

Thanks!

A: 

Android lacks built-in support for XML generation, period. Android is stronger with JSON, since it can both parse and generate JSON documents.

In terms of patching XMLBeans, you may find it quicker to find some other package that has fewer dependencies. You cannot readily import any new code that resides in the java.* or javax.* packages.

CommonsWare
+2  A: 

I'm poking in the dark here, since i haven't tried anything of this, yet:

There's this blog entry from XBinder which claims that they are releasing an android-compatible version "in a few weeks". While that might not be an option right now, they also explain a bit of how they have done it, wrapping a light StAX-like wrapper on the XmlPull support already present in Android.

(my answer originally had another paragraph on XStream working on android, but then i read the question again and saw that your problem was with getting XStream to work on the AppEngine side...)

David
Concluding from the text, this is exactly what I am looking for. Right now I am evaluating http://vtd-xml.sourceforge.net/, which works well, but is no data binder. As soon as the android-compatible version is out, I will check it.
Ice09
what feature are you looking for in xml data binder?
vtd-xml-author