0

I am trying to build an Android application.

It has a SOAP-based Web service from which it needs to consume the data.
I have a middle-ware Worklight server implementation too.

The data coming from the Web Service is huge and is actually all the data is not needed all the time. I was planning that I would use the middleware Worklight server to consume the SOAP web service, rather than the Android app itself, parse the data and then expose the required bits as a RESTful service and the data format JSON rather than SOAP XML format.

I think that this will take the load of parsing the huge XML data off the app. Is this a good approach?

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
Akshay Aroor
  • 109
  • 2
  • 8
  • XML does not map over to JSON cleanly in several cases (take for example, attributed text nodes). But there are several tools that have taken on the challenge of converting XML to JSON, and that try to smooth out the process (Jettison, XStream, json-lib). As long as you understand the process then sure, your design should work. Just understand that the intermediate processing step will slow down retrieval time for the data (so you are basically betting that your midtier can perform ETL faster than your end app can parse the huge XML payload). – Perception May 13 '13 at 11:48

1 Answers1

0

I see no problem with your overall design, i.e. consuming the large chunk of data from the SOAP call in your middleware server and then only exposing the specific things you need for your Android clients.

It will at least save you bandwidth on your Android devices (which is a really good thing) and most likely a few lines of code in your Android project since your REST data will be tailored for your specific use-cases.

JSON or XML? What better fits your needs.

I'd advice you to look at versioning your REST services though. This is a good start: Best practices for API versioning?

Community
  • 1
  • 1
Mike
  • 1,000
  • 1
  • 10
  • 18
  • Thank You Mike, I plan to parse the XML data in the middle-ware server and communicate with my Android app using JSON, as it is lightweight and much easier to read with small amount of code, I tried this with a sample app and I could see significant improvements in app performance as compared to using XML messages. – Akshay Aroor May 16 '13 at 05:44