O'Reilly logo

Java Web Services: Up and Running by Martin Kalin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Amazon’s E-Commerce Web Service

The section title has the popular and formerly official name for one of the web services that Amazon hosts. The official name is now Amazon Associates Web Service. The service in question is accessible as SOAP-based or REST-style. The service is free of charge, but it does require registration at http://affiliate-program.amazon.com/gp/associates/join. For the examples in this section, an Amazon access key (as opposed to the secret access key used to generate an authentication token) is required.

Amazon’s E-Commerce service replicates the interactive experience at the Amazon website. For example, the service supports searching for items, bidding on items and putting items up for bid, creating a shopping cart and filling it with items, and so on. The two sample clients illustrate item search.

This section examines two Java clients against the Amazon E-Commerce service. Each client is generated with Java support code from the wsimport utility introduced earlier. The difference between the two clients refines the distinction between the wrapped and unwrapped conventions.

An E-Commerce Client in Wrapped Style

The Java support code for the client can be generated with the command:

% wsimport -keep -p awsClient \
http://ecs.amazonaws.com/AWSECommerceService/AWSECommerceService.wsdl    

Recall that the -p awsClient part of the command generates a package (and, therefore, a subdirectory) named awsClient.

The source code for the first Amazon client, AmazonClientW, resides ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required