I am trying to execute a junit test on my deployed web service.But while passing the existing soap request as parameter to my deployed method I am getting the following error.
com.thoughtworks.xstream.converters.ConversionException: Cannot parse date 2016-12-09
I am using the following request.
<com.sampleclass>
<remark>TEST</remark>
<toDate>2016-12-09</toDate>
</com.sampleclass>
While my variable in the corresponding data class is.
private Date toDate;
It seems problem with you date format your passing. You have two ways to overcome this issue.
XStream xstream = new XStream(); String dateFormat = "yyyy-MM-dd"; String[] acceptableFormats = {"yyyy-MM-dd"}; xstream.registerConverter(new DateConverter(dateFormat, acceptableFormats));
Thanks,
Irham