PermaLink passing a Notes DateTime in a web service called by .NET02/24/2009 07:23:21 AM
I've gotten a few questions from Glen Rohrer about LotusScript web services.  He did all the figuring out an the result is this web service that passes Notes DateTime.  Good job Glen:


"So in my web service I create my custom class like so...

--------------------------------------------------------------

Public Class Travel
       Public Amount As Double
       Public Associate As String
       Public AssociateID As String
       Public CalculationType As String
       Public Comments As String
       Public DateEnd As XSD_DATETIME
       Public DateStart As XSD_DATETIME
       Public ID As String
       Public Percent As Double
       
       Sub New()
               Set DateStart = New XSD_DATETIME
               Set DateEnd = New XSD_DATETIME
       End Sub
End Class

--------------------------------------------------------------

In a Web Reference method, I use the following code to create the Travel Object

--------------------------------------------------------------

Dim travel as Travel
Dim NotesDate as NotesDateTime

Set travel = New Travel()
If Isdate(doc.GetItemValue("endDate")(0)) Then
       Set NotesDate = New NotesDateTime(doc.GetItemValue("endDate")(0))
       Call travel.DateEnd.SetValueFromNotesDateTime(NotesDate)
Else
       Call travel.DateEnd.SetValueFromString(DateTimeMinValue)
End If

--------------------------------------------------------------

I created a library which defined the constant "DateTimeMinValue" used above

Public Const DateTimeMinValue = "0001-01-01T00:00:00"

This format will translate to .NET's DateTime.MinValue(), which is an easy way to identify if a datetime value is null.

Thanks again for all the help!  Please feel free to use any of this info in a blog to help others! "


Commentsv

No documents found

Enter Comments^



Email addresses provided are not made available on this site.





You can use UUB Code in your posts.

[b]bold[/b]  [i]italic[/i]  [u]underline[/u]  [s]strikethrough[/s]

URL's will be automatically converted to Links


:cool: :-p :huh: :rolleyes: ;-) :-D :-( :laugh: :cry: :-\ :-o :-x :grin: :angry: :-) :emb:






Remember me    

GaryDev
The blog is hosted by the ADVISOR NETWORK.
By Gary Devendorf
Recent Entries
Calendar
March 2010
Su
Mo
Tu
We
Th
Fr
Sa
1
2
4
5
6
7
8
9
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Monthly Archive
ADVISOR.com
ADVISOR
MSDN Blogs
The BlogRoll
Lotus Domino ND6 RSS News Feed RSS Comments Feed Geo URL RSS Validator BlogSphere
Powered by
Blogsphere