Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'wsimport' is not recognized error in command prompt

I am new at web-services. I am trying to generate the stubs using this command:

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

I am getting this error in the cmd:

wsimport is not recognized

My Java environment variable system path is C:\Program Files (x86)\Java\jdk1.7.0. What am I doing wrong?


I resolved this issue by using wsimport from netbeans not from cmd...but I still don't know why I couldn't use it from cmd.

like image 923
2dor Avatar asked Jan 04 '14 11:01

2dor


People also ask

What is wsimport in Java?

The wsimport tool reads an existing WSDL file and generates the following artifacts: Service Endpoint Interface (SEI) - The SEI is the annotated Java representation of the WSDL file for the web service. This interface is used for implementing JavaBeans endpoints or creating dynamic proxy client instances. javax. xml.

How do I generate stubs in Wsimport?

You can run wsimport command from any directory where you like to generate stubs. We have published a sample soap web service which we going to use in this example. You can use this sample service URL https://test.java4coding.com/core/service/service.php?wsdl to test the wsimport command.


2 Answers

C:\Program Files\Java\jdk1.7.0_60\bin

This is where my jdk is, works for my system:

  1. Go to My computer >> right click and select properties.
  2. On the properties tab select Advanced system settings (Windows 7)
  3. Click enviroment variables
  4. select path and click edit option
  5. add
    ";C:\Program Files\Java\jdk1.7.0_60\bin"
    at the end.
  6. Done.
like image 59
baidya Avatar answered Oct 15 '22 07:10

baidya


wsimport and all other java commands are present in jdk bin directory and hence you need to update your PATH variable to include:

"C:\Program Files (x86)\Java\jdk1.7.0\bin"

instead of

"C:\Program Files (x86)\Java\jdk1.7.0"
like image 21
Juned Ahsan Avatar answered Oct 15 '22 05:10

Juned Ahsan