This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes JSON WebServices Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JSON WebServices" Watch "JSON WebServices" New topic
Author

JSON WebServices

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Hi,
Is it possible for anyone to explain why webservices which involve geocoding or map images benefit from using JSON?

Geocoding - google use this (I think)
map images - Anything to do with images can be Ajaxised with JSON.

Any better answers.

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41049
    
  43
JSON is very handy for services that are consumed by JavaScript (it's easy to create JavaScript objects from a JSON document) - so services accessed by browsers can benefit from it.

Not sure what you mean by the reference to images - JSON consists of textual data; maybe you can elaborate.


Ping & DNS - my free Android networking tools app
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1167
Luke, based on The Google Geocoding API, Google offers Geocoding API Web Services via JSON and XML.

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1167
JSON says -

Beyond size, XML lacks an explicit mechanism for representing large binary data types such as image data (although binary data can be serialized in either case by applying a general-purpose binary-to-text encoding scheme such as one of the Base-64 variants). JSON can represent them using arrays of numbers (representing bytes, or larger integer units up to the precision of 52 bits including the sign bit), because it can exactly represent IEEE-754 64-bit doubles (as specified in the ECMAScript standard).



Regards,
Dan
Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Dan Drillich wrote:JSON says -

Beyond size, XML lacks an explicit mechanism for representing large binary data types such as image data (although binary data can be serialized in either case by applying a general-purpose binary-to-text encoding scheme such as one of the Base-64 variants). JSON can represent them using arrays of numbers (representing bytes, or larger integer units up to the precision of 52 bits including the sign bit), because it can exactly represent IEEE-754 64-bit doubles (as specified in the ECMAScript standard).



Regards,
Dan


Great answer - thanks.
 
Don't get me started about those stupid light bulbs.
 
subject: JSON WebServices
 
Similar Threads
geocoding and address locator
JavaScript cookie with Hash value
Build Array in Servlet And Pass Back to Ajax Callback
Google Maps and JSON Geocoding Output
google api in java for geocoding