diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2019-07-14 10:40:17 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2019-07-14 10:40:17 +0200 |
commit | 72e8f6b70c814c47090ba2dd5cf618602e917d09 (patch) | |
tree | 5ecaa1c5a6e19fcc04f4f2b6a717b0f75cfa84fe | |
parent | e7aa179869bd0a680d0197bdbf21728ed8ebf819 (diff) |
soap: soap-invoke: Accept an instance procedure.
* debbugs/soap.scm (soap-invoke): Accept an instance procedure in
addition to a URI string.
-rw-r--r-- | debbugs/soap.scm | 16 |
1 files 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 |