Reputation: 19
I was trying to develop an JAX WS web service but on running an an ant tool for WSGEN utility getting an error, My web service consist of one method add only, Below is my piece of code..
Interface :-
package Demo;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style = Style.DOCUMENT) //optional
public interface Calculator {
@WebMethod
public int add(int a ,int b);
}
followed by the Service endpoint class
package Demo;
import javax.jws.WebService;
//Service Implementation
@WebService(endpointInterface = "Demo.Calculator")
public class CalculatorImpl implements Calculator {
@Override
public int add(int a ,int b) {
return a+b;
}
}
The build.xml is ..
<target name="wsgen" >
<exec executable="wsgen">
<arg line="-cp ./bin -keep -s ./src -d ./bin Demo.CalculatorImpl"/>
</exec>
</target>
</project>
But upon executing the build.xml getting this below error that is..
Buildfile: D:\saralworkspace\aa\build.xml
wsgen:
BUILD FAILED
D:\saralworkspace\aa\build.xml:5: Execute failed: java.io.IOException: Cannot run program "wsgen": CreateProcess error=2, The system cannot find the file specified
Please advise what went wrong in it and how to overcome from it..!!
Upvotes: 0
Views: 1556
Reputation: 3904
Use full file name in the executable tag
<exec executable="D:\Program Files\Wsge\wsgen">
Or make sure your wsgen program is on your CLASSPATH variable
Upvotes: 1