[xwiki-devs] Status: Xwiki Android Client
Hi, For now I added Wiki and Space and the Search access in xwiki-android-rest via handling JSON objects. I commited new files to repo. When I implementing access to Page resources I found that Xwiki REST sends different contents in XML and JSON For example XML content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct... is different from JSON content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct... Because of this difference I decided to deserialize XML instead of JSON. (I must modify all the class files for this). XWiki RESTful API doc ( http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI) describes XML -> Java conversion by using "org.apache.commons.httpclient". But this library seems to be larger in size. As Thomas said size does matter in Android. Therefore I decided to use "org.apache.http" which built in Android. But I got following error 06-12 20:02:55.070: WARN/dalvikvm(650): VFY: unable to resolve static method 1169: Ljavax/xml/bind/JAXBContext;.newInstance (Ljava/lang/String;)Ljavax/xml/bind/JAXBContext; Can anybody suggest me what causes this error? Best Regards, Chamika Weerasinghe
On Sun, Jun 12, 2011 at 22:05, Chamika Weerasinghe <chamikaw@gmail.com> wrote:
Hi,
For now I added Wiki and Space and the Search access in xwiki-android-rest via handling JSON objects. I commited new files to repo.
When I implementing access to Page resources I found that Xwiki REST sends different contents in XML and JSON For example XML content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct... is different from JSON content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct...
Because of this difference I decided to deserialize XML instead of JSON. (I must modify all the class files for this).
XWiki RESTful API doc ( http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI) describes XML -> Java conversion by using "org.apache.commons.httpclient".
No it's not, "org.apache.commons.httpclient" is just taking care of HTTP protocol and the example is using JAXB to do XML <-> Java which is included in Java 6 but not in Dalvik. That's why you have the following error.
But this library seems to be larger in size. As Thomas said size does matter in Android. Therefore I decided to use "org.apache.http" which built in Android.
But I got following error
06-12 20:02:55.070: WARN/dalvikvm(650): VFY: unable to resolve static method 1169: Ljavax/xml/bind/JAXBContext;.newInstance (Ljava/lang/String;)Ljavax/xml/bind/JAXBContext;
Can anybody suggest me what causes this error?
As far as I remember I already taold yoiu several time that we are using JAXB to do XML serialization and that JAXB is not included into Android (yet I hope since it's starting to be pretty sandard). You should be able to do that using Restlet android library but problem is that Restlet android lib is pretty bug so using Gson sounded like a good idea. Maybe the problem you have with Json would be fixed by an upgrade of Restlet verison used by XWiki which is in progress.
Best Regards, Chamika Weerasinghe _______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On Mon, Jun 13, 2011 at 13:48, Thomas Mortagne <thomas.mortagne@xwiki.com> wrote:
On Sun, Jun 12, 2011 at 22:05, Chamika Weerasinghe <chamikaw@gmail.com> wrote:
Hi,
For now I added Wiki and Space and the Search access in xwiki-android-rest via handling JSON objects. I commited new files to repo.
When I implementing access to Page resources I found that Xwiki REST sends different contents in XML and JSON For example XML content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct... is different from JSON content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct...
Because of this difference I decided to deserialize XML instead of JSON. (I must modify all the class files for this).
XWiki RESTful API doc ( http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI) describes XML -> Java conversion by using "org.apache.commons.httpclient".
No it's not, "org.apache.commons.httpclient" is just taking care of HTTP protocol and the example is using JAXB to do XML <-> Java which is included in Java 6 but not in Dalvik. That's why you have the following error.
But this library seems to be larger in size. As Thomas said size does matter in Android. Therefore I decided to use "org.apache.http" which built in Android.
But I got following error
06-12 20:02:55.070: WARN/dalvikvm(650): VFY: unable to resolve static method 1169: Ljavax/xml/bind/JAXBContext;.newInstance (Ljava/lang/String;)Ljavax/xml/bind/JAXBContext;
Can anybody suggest me what causes this error?
As far as I remember I already taold yoiu several time that we are using JAXB to do XML serialization and that JAXB is not included into Android (yet I hope since it's starting to be pretty sandard). You should be able to do that using Restlet android library but problem is that Restlet android lib is pretty bug so using Gson sounded like a
s/bug/big/
good idea.
Maybe the problem you have with Json would be fixed by an upgrade of Restlet verison used by XWiki which is in progress.
Best Regards, Chamika Weerasinghe _______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
-- Thomas Mortagne
On 06/12/2011 10:05 PM, Chamika Weerasinghe wrote:
Hi,
For now I added Wiki and Space and the Search access in xwiki-android-rest via handling JSON objects. I commited new files to repo.
When I implementing access to Page resources I found that Xwiki REST sends different contents in XML and JSON For example XML content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct... is different from JSON content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct...
This is wrong. The two formats should contain exactly the same information. This looks like a bug in the restlet framework we're using. Jerome already started working on the migration to restlet 2.0, let's see if it solves the problem. You can try to pull from this branch to test it locally: https://github.com/jvelo/xwiki-platform/tree/restlet-upgrade
Because of this difference I decided to deserialize XML instead of JSON. (I must modify all the class files for this).
XWiki RESTful API doc ( http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI) describes XML -> Java conversion by using "org.apache.commons.httpclient". But this library seems to be larger in size. As Thomas said size does matter in Android. Therefore I decided to use "org.apache.http" which built in Android.
But I got following error
06-12 20:02:55.070: WARN/dalvikvm(650): VFY: unable to resolve static method 1169: Ljavax/xml/bind/JAXBContext;.newInstance (Ljava/lang/String;)Ljavax/xml/bind/JAXBContext;
Can anybody suggest me what causes this error?
-- Sergiu Dumitriu http://purl.org/net/sergiu/
On Mon, Jun 13, 2011 at 2:51 PM, Sergiu Dumitriu <sergiu@xwiki.com> wrote:
On 06/12/2011 10:05 PM, Chamika Weerasinghe wrote:
Hi,
For now I added Wiki and Space and the Search access in xwiki-android-rest via handling JSON objects. I commited new files to repo.
When I implementing access to Page resources I found that Xwiki REST sends different contents in XML and JSON For example XML content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct... is different from JSON content http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduct...
This is wrong. The two formats should contain exactly the same information. This looks like a bug in the restlet framework we're using.
Jerome already started working on the migration to restlet 2.0, let's see if it solves the problem. You can try to pull from this branch to test it locally: https://github.com/jvelo/xwiki-platform/tree/restlet-upgrade
Not sure if it would solve the problem, but we could try using Jackson (http://jackson.codehaus.org/) for JSON serializing/unserializing Plugging Jackson with our Restlet implementation should be fairly easy. Jerome
Because of this difference I decided to deserialize XML instead of JSON. (I must modify all the class files for this).
XWiki RESTful API doc ( http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI) describes XML -> Java conversion by using "org.apache.commons.httpclient". But this library seems to be larger in size. As Thomas said size does matter in Android. Therefore I decided to use "org.apache.http" which built in Android.
But I got following error
06-12 20:02:55.070: WARN/dalvikvm(650): VFY: unable to resolve static method 1169: Ljavax/xml/bind/JAXBContext;.newInstance (Ljava/lang/String;)Ljavax/xml/bind/JAXBContext;
Can anybody suggest me what causes this error?
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
participants (4)
-
Chamika Weerasinghe -
Jerome Velociter -
Sergiu Dumitriu -
Thomas Mortagne