user2950329
user2950329

Reputation: 55

Amazon Product API

I'm trying to use Amazon API. I followed their pdf. I have created a directory called build, and inside a file named jaxws-custom.xml with the provided content.

However, when I run the command:

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

I get the error:

Exception in thread "main" com.sun.xml.internal.ws.streaming.XMLReaderException: Unable to create StAX reader or writer
    at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:137)
    at com.sun.tools.internal.ws.wscompile.WsimportOptions.parseBindings(WsimportOptions.java:430)
    at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:162)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:120)
    at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)
Caused by: java.io.FileNotFoundException: /a/fr-05/vol/stud/home/zimchoni/Downloads/amazon/jaxws-custom.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at java.io.FileInputStream.<init>(FileInputStream.java:101)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at java.net.URL.openStream(URL.java:1037)
    at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:135)
    ... 8 more

Any Idea what can it be ? Thanks

Upvotes: 2

Views: 653

Answers (1)

Daulat Bachhav
Daulat Bachhav

Reputation: 356

It's simple remove -b jaxws-custom.xml

wsimport -d e:/build -s e:/src -p com.ECS.client.jax http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl

Upvotes: 2

Related Questions