JAX WS Web サービスを開発しようとしていましたが、WSGEN ユーティリティ用の ant ツールを実行するとエラーが発生しました。私の Web サービスは 1 つのメソッド追加のみで構成されています。以下は私のコードです。
インターフェース :-
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);
}
続いて Service エンドポイント クラス
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;
}
}
build.xml は ..
<target name="wsgen" >
<exec executable="wsgen">
<arg line="-cp ./bin -keep -s ./src -d ./bin Demo.CalculatorImpl"/>
</exec>
</target>
</project>
しかし、build.xml を実行すると、以下のエラーが発生します。..
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
何がうまくいかなかったのか、それを克服する方法を教えてください..!!