/*
 * Created on 3.10.2006
 *
 */
package fi.seco.courses.sws.example;

import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;

import fi.seco.courses.sws.example.gen.AmazonSearchPort_PortType;
import fi.seco.courses.sws.example.gen.AmazonSearchServiceLocator;
import fi.seco.courses.sws.example.gen.Details;
import fi.seco.courses.sws.example.gen.KeywordRequest;
import fi.seco.courses.sws.example.gen.ProductInfo;

/**
 * @author jiemakel
 *
 */
public class AmazonTestClient {
	
	public static void main(String[] args) throws ServiceException, RemoteException {
		AmazonSearchServiceLocator locator = new AmazonSearchServiceLocator();
		AmazonSearchPort_PortType service = locator.getAmazonSearchPort();
		ProductInfo info = service.keywordSearchRequest(new KeywordRequest("banana", "1","books","1DPX2RFNWV0WMQWCXPG2","lite","1DPX2RFNWV0WMQWCXPG2",null,null,null));
		Details[] da = info.getDetails();
		for (int i = 0;i<da.length;i++)
			System.out.println(da[i].getProductName()+": "+da[i].getListPrice());
	}
	
}
