Amazonclientu

  • Uploaded by: Jose Torres
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Amazonclientu as PDF for free.

More details

  • Words: 128
  • Pages: 1
import import import import import import import import import

awsClient2.AWSECommerceService; awsClient2.AWSECommerceServicePortType; awsClient2.ItemSearchRequest; awsClient2.ItemSearchResponse; awsClient2.ItemSearch; awsClient2.Items; awsClient2.Item; awsClient2.AwsHandlerResolver; java.util.List;

class AmazonClientU { // U is for Unwrapped style public static void main(String[] args) { // Usage if (args.length < 2) { System.err.println("Usage: java AmazonClientW <secret key>"); return; } final String access_key = args[0]; final String secret_key = args[1]; // Create service and get portType reference. AWSECommerceService service = new AWSECommerceService(); service.setHandlerResolver(new AwsHandlerResolver(secret_key)); AWSECommerceServicePortType port = service.getAWSECommerceServicePort(); // Create request. ItemSearchRequest request = new ItemSearchRequest(); // Add details to request. request.setSearchIndex("Books"); request.setKeywords("quantum gravity"); ItemSearch item_search = new ItemSearch(); item_search.setAWSAccessKeyId(access_key); item_search.getRequest().add(request); // Invoke service operation and get response. ItemSearchResponse response = port.itemSearch(item_search);

} }

List item_list = response.getItems(); for (Items next : item_list) for (Item item : next.getItem()) System.out.println(item.getItemAttributes().getTitle());

Related Documents

Amazonclientu
June 2020 11

More Documents from "Jose Torres"