From 72e8f6b70c814c47090ba2dd5cf618602e917d09 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 14 Jul 2019 10:40:17 +0200 Subject: soap: soap-invoke: Accept an instance procedure. * debbugs/soap.scm (soap-invoke): Accept an instance procedure in addition to a URI string. --- debbugs/soap.scm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/debbugs/soap.scm b/debbugs/soap.scm index eab80f0..b142f8f 100644 --- a/debbugs/soap.scm +++ b/debbugs/soap.scm @@ -134,15 +134,17 @@ and an optional CALLBACK procedure for handling a response." (put-string port v)))) ";"))))))) -(define (soap-invoke uri op . args) +(define (soap-invoke instance op . args) "Build a SOAP request from the SOAP operation OP and the arguments -ARGS, and send the request to the SOAP service at the specified URI. -Process the response with the request's callback or return the SXML -response body." - (let* ((request (apply op args)) +ARGS, and send the request to the SOAP service of the specified +INSTANCE. Process the response with the request's callback or return +the SXML response body." + (let* ((uri (if (string? instance) instance + (instance 'soap))) + (request (apply op args)) (req-xml (call-with-output-string - (lambda (port) - (sxml->xml (soap-request-body request) port))))) + (lambda (port) + (sxml->xml (soap-request-body request) port))))) (receive (response body-port) (http-post uri #:body req-xml -- cgit v1.2.3