Re: ISO date format on SOAP interface
Re: ISO date format on SOAP interface
- Subject: Re: ISO date format on SOAP interface
- From: deivy petrescu <email@hidden>
- Date: Sat, 14 Oct 2006 14:43:06 -0400
On Oct 14, 2006, at 11:02, Gordon Maynard wrote:
I didn't although that might not work if Applescript as expecting a
data variable.
I'm happy with the solution whereby I send a 'Unix' format date as
a text string and handle the coercion inside EOModeler.
Thanks for your suggestion,
Gordon.
Gordon Maynard
m: 07 970 638 415
e: email@hidden
AIM: maynardaim
Jabber: email@hidden
On 14 Oct 2006, at 08:57, Le Stang Jean-Baptiste wrote:
Have tou tried to use ((current date) as «class isot») as string
instead ?
((current date) as «class isot») -> "2006-10-14T09:56:36"
On Oct 13, 2006, at 3:04 PM, Mark J. Reed wrote:
On 10/13/06, Gordon Maynard <email@hidden> wrote:
Feel free!
The 'isot' is what comes back from the soap call to a Web
Service developed
using WebObjects which is wrapped around a MySQL database. The
field in the
database is defined as a datetime and the entity in the
Enterprise Objects
model as a NSCalendatDate. Applescript _was_ able to handle the
value in
this form using the coercion:
set datestamp to datestamp as date
At times like this I have a renewed appreciation for typeless
languages. :)
--
Mark J. Reed <email@hidden>
_______________________________________________
Just as a matter of curiosity, did you receive my email:
On Oct 12, 2006, at 17:07, Gordon Maynard wrote:
I'm using Applescript to extract data from a Web Service developed
using WebObjects. The format of the response is as follows:
{gid:{primarykeys:{1}, entityname:"folderList"},
websafefoldername:"folderName", datestamp:«data
isot323030362D30382D31315432333A30303A30305A», foldername:"Folder
Name", folderid:1}
if I add the line:
get datestamp of theRecord as date
I get the correct result:
date "Friday, August 11, 2006 23:00:00"
However, I can't find the means to convert an Applescript date
into the ISO format which the Web Service appears to need to write
records back.
I have tried sending the "datestamp" variable straight back and I
get an error:
"http://localhost:55555/cgi-bin/WebObjects/picturesWebService.woa/
ws/managePictures got an error:
java.lang.IllegalArgumentException:
com.webobjects.foundation.NSValidation$ValidationException: Error
encountered converting value of class java.util.GregorianCalendar
to type specified in attribute 'dateStamp' of entity 'folderList'.
Conversion exception is : null"
While this may be a problem in the WebObjects application, which I
wouldn't expect this list to answer, for now the question is how
to handle the date format in Applescript so I can be confident
about the data I am sending.
Does anyone have experience of handling dates in this format?
Thanks in advance,
Gordon.
Gordon Maynard
m: 07 970 638 415
e: email@hidden
AIM: maynardaim
Jabber: email@hidden
hi Gordon,
Use the following:
get datestamp of theRecord as string
Deivy
?
I've sent you the solution, never got an acknowledgment and people
were proposing the same stuff!
The script below shows you how to get the GMT time (I assume this is
the ZULU time, but I am not sure)
<script>
set mrec to {gid:{primarykeys:{1}, entityname:"folderList"},
websafefoldername:"folderName", datestamp:((current date) - (time to
GMT)) as «class isot», foldername:"Folder Name", folderid:1}
return {get (datestamp of mrec), get (datestamp of mrec) as date, get
(datestamp of mrec) as text}
</script>
-->>{«data isot323030362D31302D31335430313A33373A3038», date "Friday,
October 13, 2006 1:37:08", "2006-10-13T01:37:08"}
I am not sure my email went through. I did get it, though.
deivy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden