You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
We have created a Datetime adapter to handle empty DateTime tag ( which we are in need to nullify a column in the db) but the below code doesn't work when enable schema validation.
Since seems that the schema validation validate the received value from the xml request message and not from the unmarshal value.
`
public class DateTimeAdapter extends XmlAdapter<String, Date>{
private String pattern = "yyyy-MM-dd'T'HH:mm:ss";
/* (non-Javadoc)
* @see javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
*/
public String marshal(Date date) throws Exception {
if(date == null)
return null;
return new SimpleDateFormat(pattern).format(date);
}
public Date unmarshal(String dateString) throws Exception
{
if(!dateString.isEmpty())
return new SimpleDateFormat(pattern).parse(dateString);
return new SimpleDateFormat(pattern).parse("1900-01-01T00:00:00");
}
We have created a Datetime adapter to handle empty DateTime tag ( which we are in need to nullify a column in the db) but the below code doesn't work when enable schema validation.
Since seems that the schema validation validate the received value from the xml request message and not from the unmarshal value.
`
public class DateTimeAdapter extends XmlAdapter<String, Date>{
}
`
Xml Message Instance
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="testtnsJ"> <soapenv:Header/> <soapenv:Body> <tes:createTest> <!--Optional:--> <request> <!--Optional:--> <requesterContext> <userId>qwd</userId> <testDate></testDate> </requesterContext> </request> </tes:createTest> </soapenv:Body> </soapenv:Envelope>
Enable schema validation
<jaxws:properties> <entry key="schema-validation-enabled" value="true" /> </jaxws:properties>
The text was updated successfully, but these errors were encountered: