Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

datetime type and web service

88 views
Skip to first unread message

claudioh

unread,
May 21, 2012, 5:56:27 PM5/21/12
to
Hi

I need to send a datetime type value to a web service via MS SOAP
client.

dtValue:=CTOT(DTOC(DATE())+" "+TIME())

Just before calling the method to send it to the ws TYPE(dtValue)
returns "T" and HB_IsDateTime(dtValue) returns .T.

The web service receives "12/30/1899 3:00:00 AM" which is Windows'
default for this data type when invalid.

Any idea?

Thanks

Claudio H

ella....@xharbour.com

unread,
May 21, 2012, 6:19:40 PM5/21/12
to
Hello,

xHarbour's "DateTime" data type is specific to xHarbour's internals.
As you are using SOAP to transfer data, and SOAP is based on XML, please find out, what's the exact syntax of the CHARACTER STRING expected as "date-time" value by the service you are talking with.

Ella

Claudio Herszage

unread,
May 21, 2012, 10:58:32 PM5/21/12
to

Ella
I was told a VB datetime type in the form #mm/dd/yyyy hh:mm/ss# form is expected.
What should I send?
Thanks
Claudio H

ella....@xharbour.com

unread,
May 22, 2012, 5:18:03 AM5/22/12
to
Hello,

I suggest a character string, like "dt" below.
Please check the slash at leftside of the seconds, maybe it's a typo...
...and I guess, the "#" is not part of the syntax, only a delimiter for human readable documentation, but who knows...


local dt:="", x:=dtos( date() ), y:=time()
dt += substr(x, 5, 2) + "/"
dt += substr(x, 7, 2) + "/"
dt += substr(x, 1, 4) + " "
dt += substr(x, 1, 2) + ":"
dt += substr(x, 3, 2) + "/"
dt += substr(x, 5, 2)


Ella

Claudio Herszage

unread,
May 22, 2012, 7:28:48 AM5/22/12
to
Ella
The slash was a typo (mine)
If I send a string the method rises an argument error but if I send a date type parameter (ie CTOD("05/20/2012") ) the ws gets "05/20/2012 03:00:00 AM"
Any other suggestion?
Thanks
Claudio H

ella....@xharbour.com

unread,
May 22, 2012, 7:58:11 AM5/22/12
to
Please try to add "#" at the start and end of the string I've built, so to respect exactly the syntax. I can't believe that they want to receive a 64-bit binary value in an XML.

Here is told, that "#" is a delimiter for literals in VB:
http://msdn.microsoft.com/en-us/library/3eaydw6e(VS.80).aspx

Here:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/3fcae8a7-fab3-4ef4-be2a-b1a5303e4401

is another discussion about converting a C++ structure into a .NET value...


Ella

Claudio Herszage

unread,
May 22, 2012, 10:08:54 AM5/22/12
to
Ella
No way to make it work sending a string.
Next test should be sending a 64-bit binary value, how can I do the conversion?
Thanks
Claudio H

ella....@xharbour.com

unread,
May 22, 2012, 4:51:13 PM5/22/12
to
Please try this:

#include "hbdll.ch"
IMPORT GetSystemTimeAsFileTime(p1) FROM Kernel32.dll

....
local cVal:=space(32)
GetSystemTimeAsFileTime( @cVal )
// and send cVal AS IS ( technically it's a 64-bit integer, holding a number of "thicks" )
....


Ella


P.S. XML has been developed to ensure system-neutral data exchange...why the earth are they expecting .net-specific memory dump ???



marți, 22 mai 2012, 17:08:54 UTC+3, Claudio Herszage a scris:
> Ella

dlzc

unread,
May 22, 2012, 7:40:33 PM5/22/12
to
Dear Ella:

On Tuesday, May 22, 2012 1:51:13 PM UTC-7, ella....@xharbour.com wrote:
...
> P.S. XML has been developed to ensure system-neutral
> data exchange...why the earth are they expecting
> .net-specific memory dump ???

How else do you sell product, if you don't really innovate?

David A. Smith

Claudio Herszage

unread,
May 22, 2012, 11:20:28 PM5/22/12
to
Ella
I'll test it tomorrow.
Anyway, since I have to send a captured datetime, not current system time, found DosDateTimeToFileTime() also in kernel32 to test.
Thanks again
Claudio H
0 new messages