@Chris: It seems your error is hidden under a generic error message returned back to your Silverlight application. I would suggest you use a HTTP sniffer such as Fiddler or WireShark to find out more in details what could be the source of it. You can easily find these free tools by searching over the Web.
I am curious about how you are passing the date/time from your date picker and the GetPIArchive Web method. TimeRange object argument taken by the GetPIArchive takes a PI absolute time, a PI relative time or an ISO 8601 absolute time. All times using ISO 8601 are passed as UTC time or with the offset from UTC. I have added an example of each below. Absolute time in PI format will be translated correctly according to the time zone. Can you verify this format?
- May 8th, 2012 is 2012-05-08
- May 8th, 2012 8:00:15 AM (UTC) is 2012-05-08T08:00:15Z
- May 8th, 2012 3:00:15 AM (Eastern Daylight Time) is 2012-05-08T03:00:15-5:00
I have also a few questions to better understand your problem.
- Where is located your Silverlight application?
- Is it on a Mac or Windows computer?
- What version of Silverlight are you using?
- What is the hypervisor used to run your virtual machine on the Mac Server?
Many thanks for the reply, I am using Fiddler, it gave me the details of 'Index is out of range. Must be non-negative and less than the size of the collection'. Which is why I started to look into the datetime ranges and with a bit of playing around found the problem.
The user picks a start and end date from two datepickers which are then passed as a datetime format into my GetPIArchive method. I was using:
arcTR.Start = timeStart.ToString();
arcTR.End = timeEnd.ToString();
arcReq.TimeRange = arcTR;
I have now forced the format, as the following:
arcTR.Start = timeStart.ToString("yyyy-MM-dd HH:mm:ss"); arcTR.End = timeEnd.ToString("yyyy-MM-dd HH:mm:ss"); arcReq.TimeRange = arcTR;
which has done the job and it is working now, I was originally trying various formats but none with the year first which I think was my issue.
I am still a little confused as to why the first method works on one server and not the other though.
In relation to your final questions, the application is currently being developed in Silverlight 5 on a Windows computer, connected to two Virtual Windows Machines on a Mac Mini Server. We are using Parrells Deskop for Mac to run the virtual machines. We wouldnt normally use a mac server, this is the first time, however we required a method to effectivly take the PI and AF servers with us to show customers and this seemed like the perfect solution as it would almost fit in your pocket :)
Many thanks for your help though,
@Chris: AFAIK, this might have influenced by the Regional Settings of both systems. The .NET Framework will use the Regional Settings to form date/time object from strings to know what the order of month, day and year is.
It is always better to control and verify he format of your date/time object.