tags:

views:

83

answers:

4

Hi!

iam about to call a service from my server. Should I use Json or Soap?

My service is in asp.net

Are there not any packages in android that has to do with the service connections?

A: 

IMHO, a REST interface encoded in JSON will be easier in Android, since there are enough classes built in to handle that. SOAP requires a third-party JAR (e.g., kSOAP2).

CommonsWare
Thanks a lot, Iam going to send pictures, and a large texts. is jason sufficient? What kind of service should create in .net, a asmx-file or WCF REST?
Troj
By the way do you have any samples of the json? (Iam new to this)
Troj
@Troj: I wouldn't touch .NET with a 10-meter pole, so I have no recommendations there. JSON does not handle pictures; AFAIK, neither does SOAP. I recommend a RESTful service, where you `HTTP PUT` the images and other resources. There are a variety of books on how to create such Web services (e.g., _RESTful Web Services_).
CommonsWare
CommonsWare why exactly wouldn't you touch .NET?
tobsen
@tobson: Just personal preference. I gave up on MS server-side a decade ago and haven't exactly missed it. It also runs really lousy on my Linux servers. :-) More seriously, I'm just saying I have no advice on .NET implementations of Web services. I apologize for any confusion my glib comment may have caused.
CommonsWare
A: 

On how to use JSON in Android http://stackoverflow.com/questions/2818697/

You could use Http Client and MultiPart Entities for sending images and large text files. http://stackoverflow.com/questions/2935946/

primalpop
A: 

Json will also be more efficient than soap as well. Check out the Google Io videos from2009. There is a great talk about optimizing apps on android and it specifically deals worth this topic...

Ben
A: 

JSON is always easier...it's much easier to parse and doesn't need a DTD..

kenyee