Sample Code: Java Client ApplicationTo access Enterprise Web Services (EWS) using the sample Java client application, follow these instructions. EnvironmentTo set up your Java environment, install the following packages according to the directions on their respective web sites: We recommend that you use Java 1.5. We also recommend that you use Axis 1.4 to ensure that the sample client application compiles correctly. Note: Contact your system administrator if you need help setting up your Java environment. Source CodeFor Java, the sample code includes API specific code and use cases. While API specific sample code helps you understand the usage of individual API, the use cases demonstrate a workflow or typical system usage. Please refer to the Build and Run section
below to know how to use these sample codes PrerequisitesThe Java sample source code below makes use of the following EWS utility files. These files abstract out the configuration and service management used in the sample source code.
Note : These files must be included in the classpath when executing the sample source code. API Specific Sample CodeThe following sample codes are available for EWS APIs :
Use Cases / WorkflowsThe following use cases are available:
Download All Source Files
| |||||||||||||||||||||||||||||
| Sr. No. | Description | |
|---|---|---|
| Step 1a. |
You need the Axis Java client stub classes to comiple
and run the sample code. You can download the pre-compiled stubs with sources: .jar (classes only), .zip, .tar.gz, .tar.bz2. Alternately, you can generate the stubs on your own by following the steps below. Download the WSDLs for these Marketing API services to your local directory:
You may want to download all the WSDLs if you plan to expand the sample client application to use more services or to execute the use cases. |
|
| Step 1b. |
Skip this step if you have downloaded the stubs listed above. Create the Axis client stub classes for all the WSDLs using Axis' wsdl2java with these arguments:
|
|
| Step 2. |
Download the sample data properties files and save them to your local directory. You can download |
|
| Step 3. | Download
|
|
| Step 4. |
Make sure that the following are in your classpath:
|
|
| Step 5. |
Modify the ewsconfig.properties file and add your acount details to the file :
|
|
| Step 6. |
Compile Java sample source code (includeing helpers) and the generated stubs. |
|
| Step 7. |
Run the sample code : For example :
|
|
There are no known issues at this time.