emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master a887c8a 4/8: packages/excorporate: Change server version l


From: Thomas Fitzsimmons
Subject: [elpa] master a887c8a 4/8: packages/excorporate: Change server version lookup
Date: Wed, 16 Mar 2016 16:08:31 +0000

branch: master
commit a887c8a8cde29a4aa3f649ec06486edbd3222dca
Author: Thomas Fitzsimmons <address@hidden>
Commit: Thomas Fitzsimmons <address@hidden>

    packages/excorporate: Change server version lookup
    
    * packages/excorporate/excorporate.el (exco--get-server-version):
    Change version lookup algorithm.
---
 packages/excorporate/excorporate.el |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/packages/excorporate/excorporate.el 
b/packages/excorporate/excorporate.el
index c32f798..8168dd3 100644
--- a/packages/excorporate/excorporate.el
+++ b/packages/excorporate/excorporate.el
@@ -497,18 +497,27 @@ the FSM should transition to on success."
 
 (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]