问题
I am currently having trouble with upload in the sample - doesn't work with below error message "Invalid Date Time value received."
It seem to be complaining about how the date is formatted as string - yyyy-MM-ddTHH:mm:ss.SS
is how the iPhone sample code originally formatted it to, changed it to yy-mm-ddTHH:mm:ss:SSS
as said in HTML5 example inline documentation, and few other formats, but no luck.
What is the correct format?
Here're what I've done to get the sample to work for download part...
As instructed, I have changed the URI in plist file.
Looking at HTML5 example, I realized the URL for webservice was in wrong format, so changed them as below..
//self.uploadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/?syncScope=DefaultScope&operation=UploadChanges&userid=%@", self.baseURL, [anc valueForKey:@"userID"]]];
self.uploadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/defaultscope/UploadChanges?userid=%@", self.baseURL, [anc valueForKey:@"userID"]]];
//self.downloadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/?syncScope=DefaultScope&operation=DownloadChanges&userid=%@", self.baseURL, [anc valueForKey:@"userID"]]];
self.downloadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/defaultscope/DownloadChanges?userid=%@", self.baseURL, anc.userID]];
回答1:
In case this helps someone else...
Found the format that works. yyyy-MM-ddTHH:mm:ss.SSSSSSS
The time format conversion seem to be done in Formatters/FormatterUtilities.cs file
来源:https://stackoverflow.com/questions/13169754/microsoft-sync-framework-toolkit-iphone-example-date-format-wrong