To use the AdSense API, write a client program in the programming language or your choice. We have tested Java, Perl, PHP, Python and C#, and have sample code for those languages. Write your client program to send a request to one of the AdSense web services, such as the AccountService or AdSenseForContentService. The relevant service will process the request and send back a response, which your client program needs to parse.
Note: A Sandbox is available for testing and debugging AdSense API clients. This service replicates the live website and lets you simulate creating AdSense accounts for new or existing publishers, associate those accounts with their own developer account, and then test operations on that account. You can write the part of your client program that sends requests and receives responses by filling out implementation to stubs that you generate from the AdSense WSDL files. You generate the stubs by downloading the WSDL files from www.google.com, at the location shown further below, and running a program to convert the WSDL files to source files in your programming language of choice. For Java, using Axis, this would be something like:
export AXIS_CLASSPATH="/java/apache_axis/axis-ant.jar:/java/apache_axis/axis.jar:/java/apache_axis/commons-discovery.jar:/java/apache_axis/commons-logging.jar:/java/apache_axis/jaxrpc.jar:/java/apache_axis/saaj.jar:/java/apache_axis/wsdl4j.jar"
java -cp $AXIS_CLASSPATH org.apache.axis.wsdl.WSDL2Java -p com.google.api.adsense.v2 AccountService.wsdl
These stub files are the starting point for your client program.
-->
Since the AdSense API runs as a web service, you don't need to install the AdSense API. The only software you need to install to use the AdSense API is the software for the programming language and toolkit that you will be using to write your client programs. For example, if you intend to write your client programs in Java, you will need to install the Java Development Kit and also a SOAP toolkit such as Axis. See the section Soap Toolkits for a list of possible toolkits for various languages.
The operations provided by a web service are defined in a WSDL (Web Services Definition Language) file which is posted on the web service's website. To connect to a web service, you need to know the URL for the WSDL. For all the AdSense API services, the URL for the WSDL has the following form:
by http://code.google.com
Friday, May 25, 2007
Subscribe to:
Post Comments (Atom)
1 comment:
IndiaStudyChannel.com is one of the Google AdSense revenue sharing sites, offering 90% of the revenue share to members. This site uses the AdSense APIs mentioned above.
Post a Comment