Thank you for downloading the Commerce API Quick-start Java Toolkit. This download contains code designed to help you begin using Zuora APIs.
- JDK 1.6
- Apache Axis 1.4
- Apache Ant
This sample zip contains:
/readme.txt - this file
/build.xml - ant build files to compile and run the test code manually
/test.properties - external property file for setting different values while running the application
/zuora.a.38.0.wsdl - The latest version of the WSDL
/lib - contains all dependent jar files to run the sample
/src - example code to execute the Zuora APIs
/.classpath & .project - project files for eclipse
Documentation and Support
API Documentation is available at http://developer.zuora.com
The following are pre-requisites to successfully run the sample code:
- A Zuora Tenant
- A Zuora User
- A Product created with a Rate Plan & Rate Plan Component (http://knowledgecenter.zuora.com/index.php/Product_Catalog), with
- The Effective Period (Start & End) of the Product/Rate Plan not expired (start < today and end > today)
- An Accounting Code specified on the Rate Plan Component (Update $AccountingCode in main.php with the code you specify)
- A Zuora Gateway set up (http://knowledgecenter.zuora.com/index.php/Z-Payments_Admin#Setup_Payment_Gateway)
- Either Authorize.net, CyberSource, PayPal Payflow Pro (production or test)
- The setting "Verify new credit card" disabled
Running the Example
- Unzip the files contained in the quickstart_java.zip file to a folder on you hard drive.
- In test.properties, specify:
- From the command line, run the test using ant
- "ant crud" to test create, update and delete of active account
- "ant subscribe" to test subscribe() call
- Run from command line as a java application
- "account-create" to test create Account. Get the proper argument from ApiTest.java to run the specific operation i,e account-update, subscribe-create etc.
Compiling the Example
From the command line, run "ant compile" to generate the Java stubs and compile the test code
Debugging the Example in Eclipse IDE
- From the command line, run "ant setup" to generate the Java stubs.
- Load the project into Eclipse.
- Copy the unzipped folder into your Eclipse workspace
- In Eclipse, create a new Java project:
- File -> New -> Java Project
- Enter project name, and point the project's root folder to the unzipped folder's location
- Click 'Next'
- Click 'Finish'
- Create a Run/Debug Configuraiton for ApiTest.java
- Navigate to src/com.zuora.api/ApiTest.java, and right click to select "Run As => Run Configurations". Click on "Arguments" tab, and specify the VM parameters as:
Updating the WSDL Version
If you want to use another WSDL version instead of the current WSDL version in the sample code, you can follow the steps below:
- In test.properties file, change the zuora.wsdl.version value
- In test.properties file, change the version number in the end point
- Copy the WSDL file to the root folder, e.g. zuora.a.37.0.wsdl
- Run "ant setup". This will re-generate the Java stubs from the new WSDL file.