[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/12] Download WSDL specification dynamically from selected serv
From: |
Felix Lechner |
Subject: |
[PATCH 04/12] Download WSDL specification dynamically from selected server. |
Date: |
Sun, 10 Mar 2024 12:00:41 -0700 |
* debbugs.el: Download WSDL specification dynamically from selected
server.
---
debbugs.el | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/debbugs.el b/debbugs.el
index 3d96d25791..7310ced0bc 100644
--- a/debbugs.el
+++ b/debbugs.el
@@ -89,16 +89,11 @@ This corresponds to the Debbugs server to be accessed,
either
:type '(choice :tag "Debbugs server" (const "gnu.org") (const "debian.org")
(string :tag "user defined port name")))
-;; It would be nice if we could retrieve it from the debbugs server.
-;; Not supported yet.
-(defconst debbugs-wsdl
- (soap-load-wsdl
- (expand-file-name
- "Debbugs.wsdl"
- (if load-in-progress
- (file-name-directory load-file-name)
- default-directory)))
- "The WSDL object to be used describing the SOAP interface.")
+(defun debbugs-download-wsdl ()
+ "The WSDL object to be used describing the SOAP interface."
+ (let* ((selected-server (alist-get debbugs-port debbugs-servers nil nil
#'equal))
+ (wsdl-url (plist-get selected-server :wsdl)))
+ (soap-load-wsdl wsdl-url)))
;; Please do not increase this value, otherwise we would run into
;; performance problems on the server. Maybe we need to change this a
@@ -127,7 +122,7 @@ t or 0 disables caching, nil disables expiring."
(lambda (response &rest _args)
(setq debbugs-soap-invoke-async-object
(append debbugs-soap-invoke-async-object (car response))))
- nil debbugs-wsdl debbugs-port operation-name parameters))
+ nil (debbugs-download-wsdl) debbugs-port operation-name parameters))
(defcustom debbugs-show-progress t
"Whether progress report is shown."
@@ -301,7 +296,7 @@ patch:
(unless (null query)
(error "Unknown key: %s" (car query)))
(prog1
- (sort (car (soap-invoke debbugs-wsdl debbugs-port "get_bugs" vec)) #'<)
+ (sort (car (soap-invoke (debbugs-download-wsdl) debbugs-port "get_bugs"
vec)) #'<)
(when debbugs-show-progress
(remove-function
(symbol-function debbugs-url-display-message-or-percentage-function)
@@ -338,7 +333,7 @@ patch:
(cons 'newest_bug
(caar
(soap-invoke
- debbugs-wsdl debbugs-port "newest_bugs" amount)))))
+ (debbugs-download-wsdl) debbugs-port "newest_bugs"
amount)))))
;; Cache it.
(when (or (null debbugs-cache-expiry) (natnump debbugs-cache-expiry))
@@ -348,7 +343,7 @@ patch:
(list (alist-get 'newest_bug status)))
(sort
- (car (soap-invoke debbugs-wsdl debbugs-port "newest_bugs" amount)) #'<)))
+ (car (soap-invoke (debbugs-download-wsdl) debbugs-port "newest_bugs"
amount)) #'<)))
(defun debbugs-convert-soap-value-to-string (string-value)
"If STRING-VALUE is unibyte, decode its contents as a UTF-8 string.
@@ -641,7 +636,7 @@ Example:
(setq
object
- (car (soap-invoke debbugs-wsdl debbugs-port "get_usertag" (car user))))
+ (car (soap-invoke (debbugs-download-wsdl) debbugs-port "get_usertag" (car
user))))
(if (null tags)
;; Return the list of existing tags.
@@ -668,7 +663,7 @@ Every message is an association list with the following
attributes:
`attachments' A list of possible attachments, or nil. Not
implemented yet server side."
- (car (soap-invoke debbugs-wsdl debbugs-port "get_bug_log" bug-number)))
+ (car (soap-invoke (debbugs-download-wsdl) debbugs-port "get_bug_log"
bug-number)))
(defun debbugs-search-est (&rest query)
"Return the result of a full text search according to QUERY.
@@ -952,7 +947,7 @@ Examples:
(setq args (vconcat args (list vec)))))
(setq result
- (car (soap-invoke debbugs-wsdl debbugs-port "search_est" args)))
+ (car (soap-invoke (debbugs-download-wsdl) debbugs-port "search_est"
args)))
;; The result contains lists (key value). We transform it into
;; cons cells (key . value).
(dolist (elt1 result)
--
2.41.0
- Re: Adding a SOAP server to Debbugs.el, (continued)
- Re: Adding a SOAP server to Debbugs.el, Michael Albinus, 2024/03/09
- [PATCH 00/12] Download WSDL for SOAP services from server, Felix Lechner, 2024/03/10
- [PATCH 02/12] Fix docstring for :affects., Felix Lechner, 2024/03/10
- [PATCH 03/12] Fix description in docstring for debbugs-ports., Felix Lechner, 2024/03/10
- [PATCH 05/12] Pass query to debbugs-get-bugs as a list; make space for WSDL., Felix Lechner, 2024/03/10
- [PATCH 07/12] Pass query to debbugs-search-est as a list; make space for WSDL., Felix Lechner, 2024/03/10
- [PATCH 06/12] Pass query to debbugs-get-usertag as a list; make space for WSDL., Felix Lechner, 2024/03/10
- [PATCH 10/12] Pass offline to debbugs-gnu-show-reports as keyword; make space for WSDL, Felix Lechner, 2024/03/10
- [PATCH 01/12] Don't hardcode gnu.org as debbugs-port for Gnus interface., Felix Lechner, 2024/03/10
- [PATCH 08/12] Pass bug-numbers to debbugs-get-status as a list; make space for WSDL., Felix Lechner, 2024/03/10
- [PATCH 04/12] Download WSDL specification dynamically from selected server.,
Felix Lechner <=
- [PATCH 09/12] Pass parameters to debbugs-soap-invoke-async as a list; make space for WSDL., Felix Lechner, 2024/03/10
- [PATCH 12/12] Download WSDL early and propagate it via keyword arguments., Felix Lechner, 2024/03/10
- [PATCH 11/12] Offer keyword arguments for WSDL to avoid repeated downloads., Felix Lechner, 2024/03/10
- Re: [PATCH 00/12] Download WSDL for SOAP services from server, Michael Albinus, 2024/03/12