473,387 Members | 1,664 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,387 software developers and data experts.

xsd:dateTime incompatibility between .Net and Apache Axis

I have to connect to a server set up by the government, where they used
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.
Nov 28 '05 #1
4 12279
On Mon, 28 Nov 2005 15:07:23 +0100, Lucvdv <re**********@null.net> wrote:
I tried sending it as an "xsd:date", but the server doesn't accept it (HTTP
error "200 - Information not available").


Oops. That error was caused by something else - the server itself seems to
be down, I get the same error on its opening page.

I'll try again when it is back up.
Nov 28 '05 #2
On Mon, 28 Nov 2005 15:20:22 +0100, Lucvdv <re**********@null.net> wrote:
On Mon, 28 Nov 2005 15:07:23 +0100, Lucvdv <re**********@null.net> wrote:
I tried sending it as an "xsd:date", but the server doesn't accept it (HTTP
error "200 - Information not available").


Oops. That error was caused by something else - the server itself seems to
be down, I get the same error on its opening page.

I'll try again when it is back up.


The server is back up, and it still doesn't work: it ignores the date if I
send it as xsd:date.
[The server takes identity details including birthdate, and returns whether
that person appears in a list. With xsd:date, it's as if the list is
empty.]
Nov 29 '05 #3
DC
Sounds like you are having an issue with XML namespaces.

Here is a working example of a C# client communicating with a Java/AXIS1.2
server, exchanging data of complex (custom) types. The complex type
includes an xsd:dateTime .
http://dinoch.dyndns.org:7070/axis1....tCtService.jsp

One of the fundamental things you should do in order to get interop to
happen between Java/AXIS (in fact any Java web services stack) and .NET is
to take the "WSDL first" approach. This means define your interface between
client and server in WSDL, and then generate from that WSDL server-side
skeletons and client-side stubs, whether Java is the server and .NET is the
client, or vice versa.

If you start with an implementation, lets say a Java class and then just pop
that up as a webservice (AXIS has some nifty support for a .jws thing that
allows all public methods to be exposed as webservice methods), you will
have some difficulty getting interop to happen. Sure it is possiblre to
do a demo, but in more complex scenarios, you'll have trouble.

See also, this page:
http://wiki.apache.org/ws/FrontPage/Axis/DotNetInterop

--
-Dino
D i n o . C h i e s a AT M i c r o s o f t . c o m

"Lucvdv" <re**********@null.net> wrote in message
news:lh********************************@4ax.com...
On Mon, 28 Nov 2005 15:20:22 +0100, Lucvdv <re**********@null.net> wrote:
On Mon, 28 Nov 2005 15:07:23 +0100, Lucvdv <re**********@null.net> wrote:
> I tried sending it as an "xsd:date", but the server doesn't accept it
> (HTTP
> error "200 - Information not available").


Oops. That error was caused by something else - the server itself seems
to
be down, I get the same error on its opening page.

I'll try again when it is back up.


The server is back up, and it still doesn't work: it ignores the date if I
send it as xsd:date.
[The server takes identity details including birthdate, and returns
whether
that person appears in a list. With xsd:date, it's as if the list is
empty.]

Nov 30 '05 #4
On Wed, 30 Nov 2005 17:21:35 -0500, "DC" <di****@online.microsoft.com>
wrote:
One of the fundamental things you should do in order to get interop to
happen between Java/AXIS (in fact any Java web services stack) and .NET is
to take the "WSDL first" approach. This means define your interface between
client and server in WSDL, and then generate from that WSDL server-side
skeletons and client-side stubs, whether Java is the server and .NET is the
client, or vice versa.


That's how it was done, at least on my side: the WSDL was generated by
Axis, I ran it through wsdl.exe to create a proxy class.

This lead to the problem with timezone/DST: the webservice (Axis)
interprets half of the dates I send it as one day earlier than I sent it.

The only change I applied (manually) to the proxy is that I added
authentication, because the server requires that.
The problem is that I don't have any control over the webservice (server
side). A third party created it for a government agency, and it's
considered finished (and being accessed by several others as well, so any
change might lead to problems there).

So I think I'll have to stick to my patchwork solution of setting the time
of day to 12:00 (noon) in each date, instead of letting it default to
midnight.

BTW, when I added authentication, I set PreAuthenticate to True. Yet by
sniffing the network packets I see that my client still sends its full
request without authenticating first, which fails, and then it re-sends the
same request with authentication.
Do you happen to know if anything can be done about that?
This is the original constructor of the proxy, as wsdl.exe made it:

Public Sub New()
MyBase.New()
Me.Url = "http://www...(snipped)
End Sub

This is my version (no other changes made anywhere):

Public Sub New(ByVal User As String, ByVal Pass As String)
MyBase.New()
Me.Credentials = New System.Net.NetworkCredential(User, Pass)
Me.PreAuthenticate = True
Me.Timeout = 30000 ' 30 seconds instead of default of 100
Me.Url = "http://www...(snipped)
End Sub
Dec 1 '05 #5

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

Similar topics

0
by: mjcsfo | last post by:
I can't seem to find a reference nor any helpful threads on this topic. I've gotten the following error in two circumstances: 1. A complex type has nested within it another complex type, in the...
2
by: BjörnHolmberg | last post by:
Hi everyone! In the following code we get a UTC offset in xml. Since I want my WAP users in UTC+02:00 to see data on a server in some US time zone, a lot of confusion will be created from this...
0
by: Pascal Brunot | last post by:
Hi, Running XSDObjectGen (1.4.1.0) on the following Infopath-generated XSD gives an "unexpected error": "Event register full" during generation (exact english error message may differ, i am...
5
by: Naveen Mukkelli | last post by:
Hi, I'm writing a server applicaiton using C# and .NET Framework. This server sends out time to all the clients. The clients are expected to be written in various platforms for example, Delphi,...
9
by: Phil B | last post by:
I am having a problem with a datetime from a web services provider The provider is sending the following SOAP response <?xml version="1.0" encoding="utf-8"?> <soap:Envelope...
4
by: luckyabhishek | last post by:
Hi I am using a java webservice in a .NET application. The xml type of a field in this webservice is xsd:datetime. When i call the webservice from the application i get a deserialization error on...
1
by: Chris Ashley | last post by:
Hi, I have an XML web service which accepts a few datetime values. We have some clients using it who are using different systems (java etc) and they need to know what the standard format for a...
4
by: jsnX | last post by:
I'm having trouble determining whether or not the period in an xsd:dateTime like this: 2006-10-04T03:42:12.3Z should in fact be a comma, as date(1) would have it: date --utc --iso-8601=ns...
2
by: talk2jyotish | last post by:
Following is a piece of XSD code <xsd:simpleType name="TimestampType"> <xsd:annotation> <xsd:documentation>Base type for a date and time stamp</xsd:documentation> </xsd:annotation>...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.