Domino 7 XML: Date problem XSD_DATETIME not correctly converted

We have the following problem, building an XML service as part of SOA that handles date/times:

Using SoapUI 1.5, we are sending an XML request to a domino application, using the following code:

<soapenv:Envelope xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:urn=“urn:DefaultNamespace”>

soapenv:Body

  <urn:APPOINTMENTSET soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

     <STARTTIME xsi:type="xsd:dateTime">2006-12-18T15:36:54</STARTTIME>

     <ENDTIME xsi:type="xsd:dateTime">2006-12-18T15:46:54</ENDTIME>

  </urn:APPOINTMENTSET>

</soapenv:Body>

</soapenv:Envelope>

The problem is that the TIME part is false when retrieved from a lotusscript:

function ApointmentSet (StartTime as XSD_DATETIME, End Time as XSD_DATETIME) as Long

        Dim dts As NotesDateTime



        AppointmentSet = Err



        Set dts = StartTime.GetValueAsNotesDateTime()

        Msgbox "XML TSD/OT " & dts.LSLocalTime

The returned date is 12/18/2006 1:01:03 AM

The date is correct

The TIME is NOT correct

To be sure, I have already tried using a timezone or not, and fractional seconds, etc… Fuzzy behaviour. Also tried to return an XSD_DATETIME from server, to use the very same format as input (acutally, I even did a copy/paste of the reply > wrong result)

Is it a BUG? Any workaround?

Or did I miss something?

Thank you for your help

Subject: Domino 7 XML: Date problem XSD_DATETIME not correctly converted

I have the same problem.

From what I see in de lsxsd.lss file . . . there’s a bug in the XSD_DATETIME class. The call . . .

Right$(ME.getValueAsString, 12)

. . . should be . . .

Right$(ME.getValueAsString, 8)

Mmm, correct the lsxsd.lss file, re-compile and save your web service … and I think you’re done.

PUBLIC CLASS XSD_DATETIME AS XSD_SIMPLETYPE

SUB SetValueFromNotesDateTime (value As NotesDateTime)

	Dim xdtc As New XSD_DATATYPE_CONVERTER

	CALL ME.setValueFromString (xdtc.getXSDDate (value) & "T" & xdtc.getXSDTime (value))

End SUB



Function GetValueAsNotesDateTime ( ) As NotesDateTime

	Dim xdtc As New XSD_DATATYPE_CONVERTER

	Dim ndt As New NotesDateTime ("")

	Call xdtc.setXSDDate (ndt, ME.getValueAsString)

	if Mid$(ME.getValueAsString,11,1) = "T" then	' if there's a time part after the required CCYY-MM-DD

		Call xdtc.setXSDTime (ndt, Right$(ME.getValueAsString, 8))

	End If

	set GetValueAsNotesDateTime = ndt

End FUNCTION

END CLASS

Subject: RE: Domino 7 XML: Date problem XSD_DATETIME not correctly converted

One more correction in the lsxsd.lss file, in the XSD_DATATYPE_CONVERTER.setXSDDate method.

’ Set the date part of a NotesDateTime From “CCYY-MM-DD …”

Sub setXSDDate (ndt As NotesDateTime, xsddate As String)

If Not ndt.IsValidDate Then ndt.LocalTime = ""

Dim timeonly As String

timeonly = ndt.TimeOnly	' preserve the time part

Dim newDt as New NotesDateTime( Mid$(xsddate,9,2) & "-" & Mid$(xsddate,6,2) & "-" & Left$(xsddate,4) & " " & timeonly )

set ndt = newDt

End Sub