473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Need help getting timezone info in webservice

(I forgot to mention that I'm using C#)
-------------------
When communicating with a server via webservices, I need to view and set the
timezone information for a simple object (it contains one DateTime and one
string).

Is there a way to force the DateTime part into a string on the client size,
so I can examine the contents (custom serializer/deserializer?)?

After about two days straight, I'm getting more familiar with XML and
webservices. However most of the examples that seem close to what I'm trying
to do are written with respect to files not webservices, or they involve
modifications on the server side.

I have several VS generated webservice references in my client side project
which have many methods based on this simple object (or arrays of them). How
do I get the webservices to use my own serializer/deserializer for this one
custom object type?

Thanks,
-Bill

Mar 8 '06 #1
5 2240
Hi Bill,

If you generate the proxy using the VS.NET, it will automatically parse the
whole DateTime information and convert the data into local DateTime. Here
are two options you can choose to get the timezone info.

1. You can put the DateTime into a string with Time Zone and parse on the
client side.
2. You don't modify the webservice and you have to parse the SOAP message
yourself.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Mar 9 '06 #2
Thanks for the reply, Kevin.

I don't have control over the way the DateTime is served up from the server,
so I'm left with a client side solution. Do I have to parse everything in
the webservice calls myself, or is there a way to just parse the object I'm
interested in? I've seen some examples which allude to this, but they are
all based on xml in and out of files and I'm not sure how it would apply to
webservice calls.

Incidentally, the reason I need to do this is because .NET maps these two
values to the same DateTime value (if the os is running in a central time
zone which observes daylight savings) and my app needs to distinguish between
the two.
<calendar xsi:type="xsd:dateTime">2006-10-29T06:30:00.000Z</calendar>
<calendar xsi:type="xsd:dateTime">2006-10-29T07:30:00.000Z</calendar>

Mar 9 '06 #3
Hi,

AFAIK, you have to parse all the SOAP messages in order to find the
timezone data. This would be very complex. .NET will convert the time to
the local time according to the regional setting on the client machine. Can
you try to distinguish it from that setting if the converted time are the
same.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Mar 10 '06 #4
Thanks for the reply Kevin.

Yes, for 8759 hours of the year, the conversion works fine. However, if the
user's system is set to 'automatically adjust for daylight savings' then
there is a problem for 1 hour of the year.

On the day of the time change, there are two 1:30 AM times. One before the
time change, and another after we roll our clocks back. These are two
distinct times in the web services, but .NET is a little to smart and
converts them both to 1:30 AM for me on the client side. I have no way to
tell whether it is the first 1:30 AM or the second. For applications like
scheduling or billing, it is important to distinguish between the two.

I assumed that this would need to be resolved at the xml level because by
the time it is converted to a DateTime object the necessary information
(timezone) is lost, hence the post to this group.

This is a critical issue for us, so I'll pursue it through paid support.
Thanks for your assistance.

Mar 10 '06 #5
Hi,

You can try to contact Microsoft PSS for this issue. Here is the contact
information.

http://support.microsoft.com/default...;OfferProPhone

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Mar 14 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gaz | last post by:
How do I modify the Hello example that comes with the JWSDP-1.1 Tutorial so that it calls a different webservice (ie; an asp.net webservice) instead of the webservice I deploy as part of the Hello...
9
by: Allen Davis | last post by:
Is there no way in ASP.NET to retrieve the client's timezone (or even local time, I'd settle for that) and passing it to the server? There must be a way of determining the timezone from which the...
4
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over...
13
by: Stuart Bishop | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi. I'm trying to determine the best way of saying 'The current time in UTC with no time zone information'. I'm currently using...
13
by: Bruno Wolff III | last post by:
Recently there has been some discussion about attaching a timezone to a timestamp and some other discussion about including a 'day' part in the interval type. These two features impact each other,...
5
by: Nathan Sokalski | last post by:
I asked a question about a week ago about how to get my local time, since my application is running on a server halfway around the world. I have determined that my code would look something like...
0
by: Bill | last post by:
When communicating with a server via webservices, I need to view and set the timezone information for a simple object (it contains one DateTime and one string). Is there a way to force the...
1
by: mmv | last post by:
Hello, Given Datetime value in a string, I wish to write a code where in I could convert the datetime to a value in particular timezone. For example, If the given datetime is 10:00 am in CST, i...
2
by: Michele Locati | last post by:
Hi to everybody I'm working with dates and time, and I can't find the way to determine the time in a generic TimeZone. Here's an example of what I'd like to do: // I get the local date and...
2
raveendrabikkina
by: raveendrabikkina | last post by:
03/17 15:45:40 error Error creating form bean of class epost.form.BpUploadForm java.lang.InstantiationException: epost.form.BpUploadForm at java.lang.Class.newInstance0(Class.java:291) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.