Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

axis webservice problem

Posted on 2007-12-02
6
Medium Priority
?
848 Views
Last Modified: 2010-05-18
I have an webservice problem.

My WSDL has an entry:

<xs:element name="myLoginDateTime" type="xs:dateTime" minOccurs="0"/>




AXIS has  generated a class which has  property as

private java.util.Calendar myLoginDateTime;




i am setting the myLoginDateTime value from a DB query result like below

java.sql.TimeStamp mylogin=rs.getTimestamp("myLOGIN");
GregorianCalendar cal=new GregorianCalendar();
cal.setTimeInMillis(mylogin.getTime());

System.out.println(cal);---->Line1

Mycustomer.setmyLoginDateTime (cal);



But the webservice response XML has a time difference of approx 3 and 1/2 hours than from printed Line1.


any suggestion ?





0
Comment
Question by:cofactor
6 Comments
 
LVL 4

Expert Comment

by:jcoombes
ID: 20391309
Sounds like there might be a timezone difference between the database and the web-service server....have you checked this?   What are locales on the two machines?   (Assuming that they *are* two different machines of course...)
0
 
LVL 9

Expert Comment

by:ysnky
ID: 20391313
may be it is updated by web service.
0
 

Author Comment

by:cofactor
ID: 20391360
jcoombes:,

i guess like that.

in fact , this question has been asked by one of my  friend . i will  confirm this as soon as i get a response from him.

OK,EVEN  if i assume , web service server has a TIMEZONE set as "GMT+x:y"   and   DB server has a TimeZone set as "GMT+a:b"  

is there a way to  remove this inconsistency ?

do i  need to add the offset ?
If so, whats the extra code need to be to added to  get this discrepancy removed ?

any pointer ?

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:cofactor
ID: 20391432
here is the info you need

webserver (sits on windows) has   GMT+3.30

DB server (sits on unix box)  has  IRST

can you please  comment now ?





0
 
LVL 23

Expert Comment

by:cmalakar
ID: 20395813
IRST is +3.30 hrs from GMT..

Hence both timezones are same..

Hence it is clear that Web Server is giving the result in GMT instead of IRST.
0
 
LVL 23

Accepted Solution

by:
cmalakar earned 1200 total points
ID: 20395828
To Get the right time, you have to add the GMT offset to the value retrieved...

Calendar obj = Calendar.getInstance();
TimeZone tz = obj.getTimeZone();
int TIMEZONE_OFFSET_VALUE =  tz.getRawOffset() / 1000;

TIMEZONE_OFFSET_VALUE  will give the offset in seconds that you need to use
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question