Update of /project/cl-soap/cvsroot/cl-soap/src In directory common-lisp.net:/tmp/cvs-serv11181/src
Modified Files: soap.lisp wsdl.lisp Log Message: unimplemented API for making SOAP calls supported by WSDL
Date: Mon Sep 12 16:28:40 2005 Author: scaekenberghe
Index: cl-soap/src/soap.lisp diff -u cl-soap/src/soap.lisp:1.4 cl-soap/src/soap.lisp:1.5 --- cl-soap/src/soap.lisp:1.4 Sat Sep 10 21:57:50 2005 +++ cl-soap/src/soap.lisp Mon Sep 12 16:28:39 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: soap.lisp,v 1.4 2005/09/10 19:57:50 scaekenberghe Exp $ +;;;; $Id: soap.lisp,v 1.5 2005/09/12 14:28:39 scaekenberghe Exp $ ;;;; ;;;; The basic SOAP protocol ;;;; @@ -79,6 +79,12 @@
;;; Call Interface
+(defvar *last-soap-call-xml* nil + "When *debug-stream* is non-nil, will contain the last SOAP call's parsed XML") + +(defvar *last-soap-result-xml* nil + "When *debug-stream* is non-nil, will contain the last SOAP result's parsed XML") + (defun soap-call (server-end-point header body @@ -96,6 +102,7 @@ (call-xml (s-xml:print-xml-string call-soap-envelope :pretty t)) result-xml result-soap-envelope) (when *debug-stream* + (setf *last-soap-call-xml* call-soap-envelope) (format *debug-stream* ";; SOAP CALL sending: ~a~%" call-xml)) (setf result-xml (do-http-request (get-url server-end-point) :method :POST @@ -105,6 +112,8 @@ (when *debug-stream* (format *debug-stream* ";; SOAP CALL receiving: ~a~%" result-xml)) (setf result-soap-envelope (s-xml:parse-xml-string result-xml)) + (when *debug-stream* + (setf *last-soap-result-xml* result-soap-envelope)) (if (eql (lxml-get-tag result-soap-envelope) 'soapenv:|Envelope|) ;; we ignore returned headers for now ;; only the first child of the body is returned, unless it is a fault
Index: cl-soap/src/wsdl.lisp diff -u cl-soap/src/wsdl.lisp:1.3 cl-soap/src/wsdl.lisp:1.4 --- cl-soap/src/wsdl.lisp:1.3 Mon Sep 12 13:24:01 2005 +++ cl-soap/src/wsdl.lisp Mon Sep 12 16:28:40 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: wsdl.lisp,v 1.3 2005/09/12 11:24:01 scaekenberghe Exp $ +;;;; $Id: wsdl.lisp,v 1.4 2005/09/12 14:28:40 scaekenberghe Exp $ ;;;; ;;;; The basic WSDL protocol: we parse the generic and soap specific parts ;;;; @@ -295,5 +295,24 @@ (let ((buffer (do-http-request url))) (with-input-from-string (in buffer) (parse-wsdl in)))) + +;; Using WSDL to make structured SOAP calls + +(defun wsdl-soap-call (wsdl + operation-name + &key + service-name + port-name + input + output) + "Use WSDL to make a SOAP call of operation/port/service using input/output" + (declare (ignore wsdl operation-name service-name port-name input output)) + ;; wsdl: either an instance of wsdl-document-definitions, a string url, a stream to parse, a pathname + ;; operation-name: string naming the operation to invoke + ;; service-name: string of service to use (if nil, use first service found) + ;; port-name: string of port of service to use (if nil, use first port found) + ;; input: plist ("name1" value1 "name2" value2) of actual parameters to use + ;; output: what to do with the result (if nil: use the contents of the first part of the output message, if possible) + t)
;;;; eof