我正在尝试学习Java Web服务。为了创建一个简单的Web服务,我已经关注this tutorial,一切正常。但现在我想用数字签名签署请求。我该怎么做?
我的网络服务:
@WebService(serviceName = "DigSignWebService")
@Stateless()
public class DigSignWebService {
@WebMethod(operationName = "hello")
public String hello(@WebParam(name = "name") String txt) {
return "Hello " + txt + " !";
}
我的客户:
public class DigSignClient {
public static void main(String[] args) throws Exception {
String name = "Darth Vader";
String k = hello(name);
System.out.println(k);
}
private static String hello(java.lang.String name) {
dgservice.DigSignWebService_Service service = new dgservice.DigSignWebService_Service();
dgservice.DigSignWebService port = service.getDigSignWebServicePort();
return port.hello(name);
}