Apache Axis to create a webservice.
The code I use to interface to the webservice is generated by wsdl.exe,
based on a .wsdl file they sent me.
Now a problem turns up with a date field they implemented as xsd:dateTime,
even though it only contains a date.
The WSLD entry is:
<element name="birthDay" nillable="true" type="xsd:dateTime"/>
The problem seems to be related to daylight saving time (whether DST was in
use or not on the date I'm passing to the service).
For about half of the dates (those in summer), everything is OK. The
actual string sent for 26 June 1978 for example, is
<birthDay xsi:type="xsd:dateTime">1978-06-26T00:00:00.0000000+02:00</birthDay> The server interprets it correctly.
With other dates, it goes wrong: for example <birthDay xsi:type="xsd:dateTime">1955-04-14T00:00:00.0000000+02:00</birthDay>
is interpreted by the service as one day earlier: April 13, 1955.
My time zone is actually GMT+01, but with DST it becomes +02, and that's
where I think the problem lies: the clock jumps back one day in
compensating for the time zone.
But how do I get rid of the +02:00 and send just the date?
I tried sending it as an "xsd:date", but the server doesn't accept it (HTTP
error "200 - Information not available").
As a temporary fix I'm just adding 12 hours to the dates before I send them
now, but I'd rather have the DST effect out completely.
BTW, my client app is a .Net Windows Forms application, but I had to resort
to a packet sniffer to see what it is actually sending and receiving.
Isn't there a way in the SOAP classes to get access to the raw XML that's
being transferred, so I can examine it in the debugger or log it to disk?
It would have saved me considerable time in diagnosing the problem if I'd
had that available from the start.
Related: if the server now returns an error code (such as the 200 above), I
have to wait until the connection times out before the proxy code returns.
If I had access to the raw response in some way, I could build in error
detection and return immediately. I've looked at what objects and
properties I can access when I use BeginGet and EndGet instead of getting
it synchronously, but I don't seem to find what I'm looking for.