Kundan Atre
Kundan Atre

Reputation: 3961

Cannot run program "wsimport": CreateProcess in eclipse

This question is for java web service beginners.
If you are facing issue to make build or for generating Client code in web service.
So I would like to suggest you follow bellow steps:-

1) Open your eclipse, i'm sure it shall be open only :)
2) Now go to File > Properties or just say (  ALT +   Enter    )**
3) You shall be prompted with new window Named "Properties"
4)Here look for the Java Build Path , then check for the Installed JRE of your eclipse.
5)If path is given only JRE but not jdk, Please change it immediately

This the only thing which was not allowing you to call wsimport command.
Because wsimport is an exe file which resides in JDK/bin directory not in JRE directory
That is why you always get such issue not able to execute command.
Now enjoy your learning.

Upvotes: 2

Views: 8350

Answers (1)

Paul Vargas
Paul Vargas

Reputation: 42040

You can try using Apache Ant for generate the client of WebService on eclipse using the wsimport tool from JDK.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project name="generate-client" default="generate-client" basedir=".">

    <property name="java.home" value="C:\Software\Java\jdk1.7.0_05" />
    <property name="wsdl.location" 
           value="http://www.webservicex.net/geoipservice.asmx?WSDL" />

    <target name="generate-client">
        <exec executable="${java.home}\bin\wsimport.exe">
            <arg line="${wsdl.location} -s src -Xdebug -verbose -Xnocompile" />
        </exec>
    </target>

</project>

Put this XML file in your project folder.

Upvotes: 3

Related Questions