I’m using spring ws 2.0.2.RELEASE
I have a web service that creates a sales order
Two of the elements in the SOAP call are dates:
<ns3:requestedDate>2012-06-06T01:00:00.000+10:00</ns3:requestedDate>
<ns3:orderDate>2012-06-06T10:25:09.681+10:00</ns3:orderDate>
Both fields are defined in the schema as xs:dateTime
When I send through the SOAP call to my service I get:
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring xml:lang="en">Validation error</faultstring>
<detail>
<spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-datatype-valid.1.2.1: '2012-06-06T01:00:00.000+10:00' is not a valid value for 'date'.</spring-ws:ValidationError>
<spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-type.3.1.3: The value '2012-06-06T01:00:00.000+10:00' of element 'ns3:requestedDate' is not valid.</spring-ws:ValidationError>
<spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-datatype-valid.1.2.1: '2012-06-06T10:25:09.681+10:00' is not a valid value for 'date'.</spring-ws:ValidationError>
<spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-type.3.1.3: The value '2012-06-06T10:25:09.681+10:00' of element 'ns3:orderDate' is not valid.</spring-ws:ValidationError>
</detail>
</SOAP-ENV:Fault>
Any idea why these valid dates are being reported as invalid by Spring?
It seems if I pass in just the date portion ‘2012-06-06’ it all works. I suppose the clue here should have been ‘date’ as opposed to ‘datetime’. The end point being called must be expecting only a date.