I'm creating a bottom-up web service from a java class using Apache CXF

In the java class, I am using java.util.Date and java.util.Calendar for two fields

When the WSDL is generated by CXF, both the elements have type="xs:dateTime". How do I generate the element to have a type of type="xs:date" instead?

I am using JAXB2.2.5

有帮助吗?

解决方案

You can override this behavior with @XmlSchemaType(name="date") annotation.

Javadoc

Maps a Java type to a simple schema built-in type.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top