cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
930
Views
0
Helpful
1
Replies

TMS - Setting Timezones Rules causes error on saveConference

owengerig
Level 1
Level 1

the guide for the tms (page 60, section: Regular Time Zone) shows some code snippets which Im having an issue replicating.  

Basically whenever I set the timezone rules retrieved via getTimeZoneRulesById to a conference and try to save it i get the error: The specified time zone information is not valid.

Why cant I use these returned timezone rules?

 

 

 

		try {
			// get booking soap service
			BookingServiceSoap bookingSoapService = ciscoTMS.getBookingServiceSoap();
			// get default conference with bookingSoapService
			Conference conference = bookingSoapService.getDefaultConference();
			// adjust start and end time to be in the future and duration of an hour
			Date now = new Date();
			Date startDate = org.apache.commons.lang.time.DateUtils.addHours(now, 8);
			Date endDate = org.apache.commons.lang.time.DateUtils.addHours(startDate, 1);
			DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss'Z'");
			dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
			conference.setStartTimeUTC(dateFormat.format(startDate));
			conference.setEndTimeUTC(dateFormat.format(endDate));
			// its in the future so set state to pending
			conference.setConferenceState(new ConferenceState(com.avispl.symphony.cisco.tms.sdk.v15.booking.ConferenceStatus.Pending));
			// set title
			conference.setTitle("Unit Test XX-" + now.getTime());
			// get timezone rules
			TimeZoneRule[] timeZoneRules = bookingServiceSoap.getTimeZoneRulesById("Central Standard Time");
			System.out.println("Timezone rules returned successfully, count:" + timeZoneRules.length);
			// set timezone rules
			conference.setConferenceTimeZoneRules(timeZoneRules);
			// save conference
			conference = bookingSoapService.saveConference.saveProprietaryConference(conference);
			// delete conference if no errors
			bookingSoapService.deleteConferenceById(String.valueOf(conference.getConferenceId()));
		} catch (Exception e) {
			System.out.println("Error: " + e.getMessage());
		}
	

Output:

 

Timezone rules returned successfully, count:2
Error: The specified time zone information is not valid.

1 Accepted Solution

Accepted Solutions

owengerig
Level 1
Level 1

the issue stemmed from the validFrom field

 

TMS is expecting 2007-01-01T00:00:00

But we are sending (including the ms) 2007-01-01T00:00:00.000Z

 

its a nullable field so thats what i did and now the above is working

 

FYI you really wouldnt know it without tracing it with something like wireshark

View solution in original post

1 Reply 1

owengerig
Level 1
Level 1

the issue stemmed from the validFrom field

 

TMS is expecting 2007-01-01T00:00:00

But we are sending (including the ms) 2007-01-01T00:00:00.000Z

 

its a nullable field so thats what i did and now the above is working

 

FYI you really wouldnt know it without tracing it with something like wireshark