Update of /project/cl-soap/cvsroot/public_html In directory common-lisp.net:/tmp/cvs-serv11824
Modified Files: google-adwords-api.html Log Message: more structured layout
Date: Sat Oct 1 13:18:12 2005 Author: scaekenberghe
Index: public_html/google-adwords-api.html diff -u public_html/google-adwords-api.html:1.3 public_html/google-adwords-api.html:1.4 --- public_html/google-adwords-api.html:1.3 Sat Oct 1 11:24:11 2005 +++ public_html/google-adwords-api.html Sat Oct 1 13:18:11 2005 @@ -26,7 +26,11 @@ ;;; apparently there are different XML Schema Defintion namespace URIs, Google is using this one:
(s-xml:register-namespace "http://www.w3.org/2001/XMLSchema" "xsd" :xsd)</pre> - Next, parse the WSDL of the service that you want to access and have a look at it. +We are now ready to look at some services. +</p> +<h4>Example 1: Calling getMethodCost in the InfoService</h4> +<p> + Parse the WSDL of the service that you want to access and have a look at it. <pre>CL-SOAP 11 > (describe-wsdl-soap (wsdl-cache-get "https://adwords.google.com:443/api/adwords/v2/InfoService?wsdl")) WSDL Document Definitions Service: InfoService @@ -81,7 +85,7 @@ (getOperationCountResponse ("getOperationCountReturn" :LONG) 1 ) 1 </pre> The input and output characteristics of each operation are described in some detail. - Example lisp template code of actaul input and output are also given (along with multiplicity indication, whether elements are required, optional, can occur zero ore more times, or one or more times). + Example lisp template code of actual input and output are also given (along with multiplicity indication, whether elements are required, optional, can occur zero ore more times, or one or more times). </p> <p> Given that you understand a particular operation, you can implement it quite easily. @@ -117,6 +121,7 @@ </getMethodCost> </soapenv:Body> </soapenv:Envelope> + ;; SOAP CALL receiving: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" @@ -156,8 +161,9 @@ XML was beautified a little bit ;-) Note that two values are returned: the actual value and the headers. </p> +<h4>Example 2: Calling estimateKeywordList in the TrafficEstimatorService</h4> <p> - A more complicated example comes from the <a href="http://www.google.com/apis/adwords/developer/index.html">introduction to the Google AdWords API</a>: estimating the traffic for keywords. Again, we first look at the interpreted WSDL: + This more complicated example is also described in the <a href="http://www.google.com/apis/adwords/developer/index.html">introduction to the Google AdWords API</a>: estimating the traffic for keywords. Again, we first look at the interpreted WSDL: <pre>CL-SOAP 43 > (describe-wsdl-soap (wsdl-cache-get "https://adwords.google.com:443/api/adwords/v2/TrafficEstimatorService?wsdl")) WSDL Document Definitions Service: TrafficEstimatorService @@ -256,6 +262,7 @@ :headers (make-google-headers)))</pre> Now we can test it, passing multiple requests and receiving multiple responses: <pre>CL-SOAP 192 > (estimate-keyword-list '(("flowers" "Broad" 50000) ("tree" "Broad" 50000))) + ;; SOAP CALL sending: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:google="https://adwords.google.com/api/adwords/v2" xmlns="https://adwords.google.com/api/adwords/v2%22%3E; <soapenv:Header> @@ -280,6 +287,7 @@ </estimateKeywordList> </soapenv:Body> </soapenv:Envelope> + ;; SOAP CALL receiving: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" @@ -334,6 +342,6 @@
((GOOGLE:|responseTime| . "412") (GOOGLE:|operations| . "2") (GOOGLE:|units| . "50"))</pre> That is all for now! More example and testing code can be found in the project's source tree. -<p>$Id: google-adwords-api.html,v 1.3 2005/10/01 09:24:11 scaekenberghe Exp $</p> +<p>$Id: google-adwords-api.html,v 1.4 2005/10/01 11:18:11 scaekenberghe Exp $</p> </body> </html>