Amazon Product Advertising API Signature?
Do you know how to set the signature, using the Amazon Product Advertising API? I know how to create the signature, but I really do not get how to set it ?
In the following code I initialize the ASWECommerceService and I try to prepare my search, but when I try to run it - I just get a 404 Bad Request. I think that the signature is missing, but how to set it in Java?
String secretKey = "abcdef";
String awsKey = "ghijklmnopqrst";
AWSECommerceService service = new AWSECommerceService();
service.setHandlerResolver(new AwsHandlerResolver(secretKey));
AWSECommerceServicePortType port = service.getAWSECommerceServicePort();
ItemSearchRequest itemRequest = new ItemSearchRequest();
itemRequest.setSearchIndex("All");
itemRequest.setKeywords("Star Wars");
itemRequest.getResponseGroup().add("Large");
itemRequest.getResponseGroup().add("Images");
ItemSearch ItemElement = new ItemSearch();
ItemElement.setAWSAccessKeyId(awsKey);
ItemElement.setAssociateTag("xyz-21");
ItemElement.getRequest().add(itemRequest);
ItemSearchResponse response = port.itemSearch(ItemElement);
Thanks for helping!
Regards Marko
链接地址: http://www.djcxy.com/p/38966.html上一篇: 警告:未保护的私钥文件! 尝试SSH到Amazon EC2实例时
下一篇: 亚马逊产品广告API签名?