02-02-2018 08:18 AM - edited 03-18-2019 01:50 PM
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.
Solved! Go to Solution.
04-12-2018 11:38 AM - edited 04-12-2018 11:39 AM
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
04-12-2018 11:38 AM - edited 04-12-2018 11:39 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide