我的网络服务看起来像
import entities.Expense;
import java.math.BigDecimal;
import java.util.Date;
import javax.ejb.EJB;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import logic.ExpenseSessionBeanLocal;
/**
*
* @author nikola
*/
@WebService(serviceName = "ExpenseWebService")
@Stateless()
public class ExpenseWebService {
@EJB
private ExpenseSessionBeanLocal ejbRef;// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Web Service Operation")
@WebMethod(operationName = "makeExpenseOnce")
public Expense makeExpenseOnce(@WebParam(name = "expenseName") String expenseName, @WebParam(name = "expenseRecipient") String expenseRecipient, @WebParam(name = "purpose") String purpose, @WebParam(name = "username") String username, @WebParam(name = "expenseDate") Date expenseDate, @WebParam(name = "amount") BigDecimal amount, @WebParam(name = "currency") String currency) {
return ejbRef.makeExpenseOnce(expenseName, expenseRecipient, purpose, username, expenseDate, amount, currency);
}
}
测试图像如下
如何以 javax.xml.datatype.XMLGregorianCalendar 作为参数在测试中输入日期?