Web服务测试ejb3作为Date参数传递

时间:2013-05-03 01:14:11

标签: web-services testing ejb-3.0 glassfish-3

我的网络服务看起来像

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);
    }

}

来自测试的图片在

之下

enter image description here

如何使用javax.xml.datatype.XMLGregorianCalendar作为参数在测试中输入日期?

1 个答案:

答案 0 :(得分:1)

AFAIK无法将对象传递给Webservice-Tester(除了字符串)。例如,至少我没有设法发布BigIntegers。