Search code examples
javaweb-servicesxsdwsdljax-rpc

Java web service, xsd date instead of dateTime


In Java EE 1.4 using JAX-RPC 1.1, how can i expose web service, so the wsdl has a complex type (person) where one of the properties of the person is a date which is shown in the WSDL/XSD as only a date (such as a birthdate) instead of a dateTime (where the time is not wanted) in the WSDL/XSD?

i would like the xsd referenced in the wsdl to have

<xs:element name="birthdate" type="xs:date"/>

instead of

<xs:element name="birthdate" type="xs:dateTime"/>

java.util.Calendar and java.util.Date both seem to cause the xsd datatype to be dateTime when rendered in in wsdl/xsd.

I know java EE 1.4 doesnt have the annotations like java EE 5, but is there any way to tell the web service to use the xs:date datatype?


Solution

  • I actually did figure out how to do this properly.

    in the WEB-INF/wsdl/(schemaname).xsd I changed the datatype to date from dateTime and redeploy the service and it works with my existing java.util.Calendar types.