Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 8th, 2006, 02:35 PM
Bill
Guest
 
Posts: n/a
Default 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

  #2  
Old March 9th, 2006, 07:05 AM
Kevin Yu [MSFT]
Guest
 
Posts: n/a
Default RE: Need help getting timezone info in webservice

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."

  #3  
Old March 9th, 2006, 02:45 PM
Bill
Guest
 
Posts: n/a
Default RE: Need help getting timezone info in webservice

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>

  #4  
Old March 10th, 2006, 06:05 AM
Kevin Yu [MSFT]
Guest
 
Posts: n/a
Default RE: Need help getting timezone info in webservice

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."

  #5  
Old March 10th, 2006, 05:05 PM
Bill
Guest
 
Posts: n/a
Default RE: Need help getting timezone info in webservice

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.

  #6  
Old March 14th, 2006, 05:25 AM
Kevin Yu [MSFT]
Guest
 
Posts: n/a
Default RE: Need help getting timezone info in webservice

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."

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles