[cl-soap-cvs] CVS update: cl-soap/src/wsdl.lisp
Sven Van Caekenberghe
scaekenberghe at common-lisp.net
Mon Sep 26 11:14:56 UTC 2005
Update of /project/cl-soap/cvsroot/cl-soap/src
In directory common-lisp.net:/tmp/cvs-serv23484/src
Modified Files:
wsdl.lisp
Log Message:
incorporated wsdl caching to main code
Date: Mon Sep 26 13:14:55 2005
Author: scaekenberghe
Index: cl-soap/src/wsdl.lisp
diff -u cl-soap/src/wsdl.lisp:1.17 cl-soap/src/wsdl.lisp:1.18
--- cl-soap/src/wsdl.lisp:1.17 Mon Sep 26 12:52:45 2005
+++ cl-soap/src/wsdl.lisp Mon Sep 26 13:14:55 2005
@@ -1,6 +1,6 @@
;;;; -*- mode: lisp -*-
;;;;
-;;;; $Id: wsdl.lisp,v 1.17 2005/09/26 10:52:45 scaekenberghe Exp $
+;;;; $Id: wsdl.lisp,v 1.18 2005/09/26 11:14:55 scaekenberghe Exp $
;;;;
;;;; The basic WSDL protocol: we parse the generic and soap specific parts
;;;;
@@ -300,6 +300,25 @@
(let ((buffer (do-http-request url)))
(with-input-from-string (in buffer)
(parse-wsdl in))))
+
+;; A simple caching mechanism for WSDL's by URL
+
+(defvar *wsdl-cache* (make-hash-table :test #'equal))
+
+(defun wsdl-cache-get (url)
+ "Access a possibly cached WSDL url, downloading and parsing it if necessary"
+ (let ((cached (gethash url *wsdl-cache*)))
+ (if cached
+ cached
+ (setf (gethash url *wsdl-cache*) (parse-wsdl-url url)))))
+
+(defun wsdl-cache-clear (url)
+ "Clear the WSDL caching of url"
+ (remhash url *wsdl-cache*))
+
+(defun wsdl-cache-clear-all ()
+ "Clear the whole WSDL cache"
+ (clrhash *wsdl-cache*))
;; Interpreting the WSDL model
More information about the Cl-soap-cvs
mailing list