Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon Product Advertising API does not Match Documentation (Java)?

I'm using the tutorial for Amazon Product Advertising API (here) for Java. I've generated the client code via the WSDL they provide. When going through the code for an ItemLookup, I get to a section where I reference AWSECommerceServicePortType.itemLookup() by passing in an ItemLookup object, I get a compile error. It seems that .itemLookup() is actually looking for quite a number of params - in other words, the method signature does not match the tutorial. What am I missing?

like image 468
Scott Avatar asked Jul 13 '26 09:07

Scott


1 Answers

To generate the Product Advertising API Client Side Library stubs

1. Go to the directory where you want to generate the stubs and create a "build" directory and a "src" directory. All of the generated source code will go under the "src" folder.

2. Create a custom binding to disable "Wrapper Style" code generation.

<jaxws:bindings
wsdlLocation="http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
<jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>

This step is necessary because the IDE does not support wrapper style generated code.

3. Run the command:

wsimport -d ./build -s ./src -p com.ECS.client.jax http://ecs.amazonaws.com/AWSECommerceService/AWSECommerceService.wsdl -b jaxws-custom.xml .

You can find the generated stubs in the path, com.ECS.client.jax .

Extract from the docs (page 10 from the pdf file)

like image 86
Igor Popov Avatar answered Jul 16 '26 00:07

Igor Popov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!