Web Service 常见有关问题(一) —— 不能被识别的基本类型
Web Service 常见问题(一) —— 不能被识别的基本类型
Web Service 在进行接口封装过程中,遇到调用实体类的情况,接口会自动去识别实体类数据的基本类型。例如 int、String等。在此,我们需要注意的是,有些数据类型是不能被web service 所识别的。其中常见的日期类型,如果我们的基本类型采用java.sql.Date的话是会报错的(报错信息类似于如下所示)。而应当用java.util.Date类。
java.sql.Date does not have a no-arg default constructor.
this problem is related to the following location:
at java.sql.Date
at public java.sql.Date com.bdqns.ws.axis2.two.bean.Customer.getCustomerBothdate()
at com.bdqns.ws.axis2.two.bean.Customer
at private com.bdqns.ws.axis2.two.bean.Customer com.bdqns.ws.axis2.two.impl.jaxws.GetCustomerByIdResponse._return
at com.bdqns.ws.axis2.two.impl.jaxws.GetCustomerByIdResponse