Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Favorite libs for SOAP & REST Clients  RSS feed

 
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a WCFRIA C# SOAP server and a Java Spring REST/JSON server that I want to access from my first android app.
I need to implement forms based authentication: I need to authenticate a username and password and receive a session ID for subsequent calls.

I see there are several prospective libraries for building clients.
What are your favorites? Jersey Client? Apache HTTPClient?

While I was looking in maven I saw some client libraries with "android" in them. Do I need to use one of these? Will these run in a desktop app outside the emulator.

Can I expect to write a prototype desktop SWING client in eclipse to test my code and then cut and paste this java SOAP client code (and REST client code) into an android app and have that android app work?

Thanks
Siegfried
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many times Java libs won't work in Android due to missing dependencies and vice versa. You're better off getting an Android specific library and coding directly in the Android environment. Try http://loopj.com/android-async-http/ It solves some Android specific problems which you would have to re-solve if you did manage to get a straight Java library working.
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For SOAP I think pretty much the only game in town in ksoap2-android, but few people use SOAP on a mobile device.

For REST, I generally use the built-in Apache HTTPClient library in an AsyncTask, although the library Steve mentions looks interesting for some of the extra features it has. Haven't needed those so far, though.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!