Reputation: 41
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?
Upvotes: 4
Views: 1057
Reputation: 10093
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)
Upvotes: 2