[cl-soap-cvs] CVS update: cl-soap/test/test-google-adwords.lisp

Sven Van Caekenberghe scaekenberghe at common-lisp.net
Mon Sep 19 16:56:16 UTC 2005


Update of /project/cl-soap/cvsroot/cl-soap/test
In directory common-lisp.net:/tmp/cvs-serv21091/test

Modified Files:
	test-google-adwords.lisp 
Log Message:
added return header parsing to soap-call

Date: Mon Sep 19 18:56:14 2005
Author: scaekenberghe

Index: cl-soap/test/test-google-adwords.lisp
diff -u cl-soap/test/test-google-adwords.lisp:1.2 cl-soap/test/test-google-adwords.lisp:1.3
--- cl-soap/test/test-google-adwords.lisp:1.2	Fri Sep 16 14:54:36 2005
+++ cl-soap/test/test-google-adwords.lisp	Mon Sep 19 18:56:14 2005
@@ -1,6 +1,6 @@
 ;;;; -*- mode: lisp -*-
 ;;;;
-;;;; $Id: test-google-adwords.lisp,v 1.2 2005/09/16 12:54:36 scaekenberghe Exp $
+;;;; $Id: test-google-adwords.lisp,v 1.3 2005/09/19 16:56:14 scaekenberghe Exp $
 ;;;;
 ;;;; Some test on the Google AdWords API (not publically available)
 ;;;;
@@ -54,18 +54,18 @@
 ;;; manual calls
 
 (defun getUsageQuotaThisMonth ()
-  (let* ((xmethods (make-soap-end-point "https://adwords.google.com:443/api/adwords/v2/InfoService"))
-         (result (soap-call xmethods 
-                            `((google:|email| ,*google-adwords-email*)
-                              (google:|password| ,*google-adwords-password*)
-                              (google:|useragent| ,*google-adwords-user-agent*)
-                              (google:|token| ,*google-adwords-token*))
-                            `(google:|getUsageQuotaThisMonth|)
-                            :envelope-attributes `(:|xmlns| ,+google-adwords-ns-uri+))))
+  (multiple-value-bind (result headers)
+      (soap-call (make-soap-end-point "https://adwords.google.com:443/api/adwords/v2/InfoService")
+                 `((google:|email| ,*google-adwords-email*)
+                   (google:|password| ,*google-adwords-password*)
+                   (google:|useragent| ,*google-adwords-user-agent*)
+                   (google:|token| ,*google-adwords-token*))
+                 `(google:|getUsageQuotaThisMonth|)
+                 :envelope-attributes `(:|xmlns| ,+google-adwords-ns-uri+))
     (if (eql (lxml-get-tag result) 'google:|getUsageQuotaThisMonthResponse|)
         (let ((contents (lxml-find-tag 'google:|getUsageQuotaThisMonthReturn| (rest result))))
           (if contents
-              (coerce (parse-integer (second contents)) 'integer)
+              (values (parse-integer (second contents)) headers)
             (error "Expected a <getUsageQuotaThisMonthReturn> element")))
       (error "Expected a <getUsageQuotaThisMonthResponse> element"))))
   




More information about the Cl-soap-cvs mailing list