Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Service Time Zone Offset Missing

Status
Not open for further replies.

bustell

Programmer
Mar 22, 2002
159
US
I am having trouble with a server that is not returning the time zone offset in a Web service response. From what I've read on the internet, it should always return the time zone offset. I need it but it is missing. It works on my local development machine but not on my test server. Both are set for Eastern Time GMT-5 (4 right now because of daylight savings time).

Below is my test code (.Net 1.1):
Code:
<WebMethod(Description:="Testing Time Zone Offset", EnableSession:=False, CacheDuration:=0)> _
Public Function GetTime() As DateTime
    Dim d As DateTime = #5/28/2009 8:00:00 AM#
    Return d
End Function

Local development machine
Windows XP
Visual Studio 2003
IIS 5.1

Test machine
Windows Server 2003
IIS 6.0

Response From Local Development machine
Code:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/"[/URL] xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema">[/URL]
  <soap:Body>
    <GetTimeResponse xmlns="https//portal.bccsoftware.com/webservices/WMM/">
      <GetTimeResult>2009-05-28T08:00:00[red].0000000-04:00[/red]</GetTimeResult>
    </GetTimeResponse>
  </soap:Body>
</soap:Envelope>


Response From Test machine
Code:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/"[/URL] xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema">[/URL]
  <soap:Body>
    <GetTimeResponse xmlns="https//portal.bccsoftware.com/webservices/WMM/">
      <GetTimeResult>2009-05-28T08:00:00</GetTimeResult>
    </GetTimeResponse>
  </soap:Body>
</soap:Envelope>

Notice that the response from the test machine is not returning the time zone offset.

Note that this does appear to be happening on our production machine which is also a Server 2003 (IIS6) machine, but I have not been thorough test with it yet.

Does anyone have any thoughts on this? I've searched Google and all I seem to find are people who are getting the offset and do not want it. I'm not getting the offset and do want it.


Pat B
 
Well, this is a good one. Some how the IIS configuration for the test site on the test server was set to use ASP.NET 2 in the site properties ASP.NET tab. This site is still a 1.1 site.

Changing the ASP.NET version from 2.0.50727 to 1.1.4322 seems to have fixed the problem.

Wish I knew how that setting got changed.


Pat B
 
I think Server 2003 (IIS6) uses .net 2.0 as the default. Could be wrong though.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top