I have a jax-ws web-service with web-method:
@WebMethod
void SetCurrentDate(Date date)
In generated wsdl parameter date has type xs:dateTime, but i need xs:date. I tried XmlGregorianCalendar, but it maps to xs:anySimpleType, also i tried @XmlSchemaType, but it's not allowed for parameters. How can I generate wsdl with xsd:date instead of xsd:dateTime?
Looks like only way to do it is by using annotation @RequestWrapper (for jax-ws-impl and apache cxf):
@WebMethod
@RequestWrapper(className = "....SetCurrentDateRequest")
void SetCurrentDate(Date date)
And request wrapper:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "setCurrentDateRequest", propOrder = {
"date"
})
public class SetCurrentDateRequest {
@XmlSchemaType(name="date")
protected Date date;
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
}