Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

timezone information from zipcode

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I wanted to know if there is way in java to get the timezone information from zipcode.

Thanks,
Samanth marisetty.
 
Marshal
Posts: 28271
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not in the standard Java API, but if you have access to the Internet you could send a request to this web service.
 
Sam Venkata
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul,

But I want to be able to send zipcode from my java program and be able to get the timezone information back. Is that possible?

Thanks,
Samanth Marisetty.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's exactly what that service provides, isn't it?

Get State Code,City,Area Code,Time Zone,Zip Code by Zip Code



If it's accessible through a web page (in other words, HTTP), then you can write a Java client that accesses it.
 
Sam Venkata
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I got the wsdl from the service you mentioned and generate classes using wsdl2java axis tool.


is the method generated to get the info based on zip, but the response object
NET.webserviceX.www.GetInfoByZIPResponseGetInfoByZIPResult does not have any information about the timezone and also I see some classes like
GetInfoByAreaCode, GetInfoByCity, GetInfoByState but not GetInfoByZipCode.
Is there anything that could be missing in the wsdl? I tried to compare the operations, bindings aswell but could not find anything missing.

could somebody please help me..

Thanks,
Samanth.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if I submit a request like

http://www.webservicex.net/uszip.asmx/GetInfoByZIP?USZip=94102

I get the following response:

Apparently the time zone "P" statnds for Pacific time. Similarly "M" is used for Mountain time. Unfortunatly this undocumented, craptastic system does not allow them to distinguish between Denver (which uses Daylight Saving Time in the summer) and Phoenix (which does not). So I'm not sure how useful it really is. It's also extremely slow. Which may be fair, considering it's free. But I think you might spend some time googling

"zip code" "time zone" "web service"

to see what other similar services are out there. There are several that provide more info, including daylight saving info, for a price. There may be another free service with better info; I don't know. You can also purchase raw data files from various sources which allow you to look up this info more directly on your server, without hitting a web service each time.
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic