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?
Asked
Active
Viewed 995 times
3
-
and 5 years later again the documentation does not match the solution that needs to be implemented so you can make SOAP calls to the api, i had to read all the stack overflow questions and try millions different code combinations so i can make the solution to work Maybe for the REST calls this is little bit easy – Mr.Java Jun 15 '16 at 07:34
1 Answers
2
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 .

Igor Popov
- 9,795
- 7
- 55
- 68