Amazon offers a rich Web service interface to visit their online content. To help you understand how to use these Web services. Amazon also provides a comprehensive sample application to show how to use all exposed operations. With step-by-step instructions, this article shows you how to modify, build, run, and debug the Mazon sample application in the NetBeans IDE. This gives you an idea of all the benefits of NetBeans, such as code completion, code linking, and integrated Javadoc help. There is also the functionality of the debugger, albeit a single-step but monitored variable that gives you an insight into the operating mechanism of Amazon Web services.
Configuring the Environment
Installing Java and NetBeans
Amazon Web Services works best under J2SE 1.4.2. If you don't have SE 1.4.2 and NetBeans installed, download the NetBeans IDE and the 2SE SDK.
Amazon E-Commerce Services (ECS)
Registered as an Amazon Web Services developer. Each Amazon Web service requires a subscription ID parameter, which you can obtain after registering.
Download and extract Java soap and other sample applications (2.7MB). This article assumes that the sample program has been uncompressed to the root directory.
Create a NetBeans application
1. Start NetBeans.
2. Select File>new Project (ctrl+shift+n).
3. Under General category, select Java Project with Existing Sources.
4. Name the project Amazonsample and select the folder in which to store the project. Click Next.
5. The Java source code for all Amazon sample applications is in the root directory of the extracted file Aws4sample_javatool. Use this folder as the source Code package folder and click Next.
Add the necessary jar files and run the application
1. Click the right mouse button on the library node of the Amazonsample project and select Add Jar/folder ....
2. Browse the Aws4sample_javatool directory and select the jar package below (you can hold down the CTRL key to select multiple jar packages at once)