(:unrecoverable-error
(list :shutting-down-on-error state-data nil))
(:retrieve-xml
- (let ((service-url (plist-get state-data :service-url)))
- (url-retrieve (concat service-url "?wsdl")
+ (let* ((service-url (plist-get state-data :service-url))
+ (wsdl-url (replace-regexp-in-string "/[^/]*$" "/Services.wsdl"
+ service-url)))
+ (url-retrieve wsdl-url
(lambda (status)
(let ((data-buffer (current-buffer)))
(unwind-protect
(progn
(plist-put state-data :failure-message
(format "Failed to retrieve %s"
- service-url))
+ wsdl-url))
(fsm-send fsm :unrecoverable-error))
(plist-put state-data
:service-xml
(defun exco--get-server-version (wsdl)
"Extract server version from WSDL."
- (catch 'found
- (dolist (attribute
- (soap-xs-type-attributes
- (soap-xs-element-type
- (soap-wsdl-get
- '("http://schemas.microsoft.com/exchange/services/2006/types"
- . "RequestServerVersion")
- wsdl 'soap-xs-element-p))))
- (when (equal (soap-xs-attribute-name attribute) "Version")
- (throw 'found (soap-xs-attribute-default attribute))))
- (warn "Excorporate: Failed to determine server version")
- nil))
+ (let ((warning-message "Excorporate: Failed to determine server version")
+ (namespace "http://schemas.microsoft.com/exchange/services/2006/types")
+ (name "RequestServerVersion")
+ (found-version nil))
+ (unwind-protect
+ (setq found-version
+ (catch 'found
+ (dolist (attribute
+ (soap-xs-type-attributes
+ (soap-xs-element-type (soap-wsdl-get
+ `(,namespace . ,name)
+ wsdl 'soap-xs-element-p))))
+ (when (equal (soap-xs-attribute-name attribute) "Version")
+ (throw 'found (car (soap-xs-simple-type-enumeration
+ (soap-xs-attribute-type attribute))))))
+ (warn warning-message)
+ nil))
+ (if found-version
+ found-version
+ (warn warning-message)
+ nil))))
(define-enter-state exco--fsm :retrieving-data
(_fsm state-data)
end 'dateTime)))
(location (cdr (assoc 'Location calendar-item)))
(to-invitees (cdr (assoc 'DisplayTo calendar-item)))
- (main-invitees (mapcar 'org-trim (split-string to-invitees ";")))
+ (main-invitees (when to-invitees
+ (mapcar 'org-trim
+ (split-string to-invitees ";"))))
(cc-invitees (cdr (assoc 'DisplayCc calendar-item)))
(optional-invitees (when cc-invitees
(mapcar 'org-trim