Skip to content

Instantly share code, notes, and snippets.

@xexes
Forked from sachin-handiekar/dateBinding.xml
Created January 31, 2018 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xexes/1d4f87e4fbbe879fe543a3ff7f28525c to your computer and use it in GitHub Desktop.
Save xexes/1d4f87e4fbbe879fe543a3ff7f28525c to your computer and use it in GitHub Desktop.
JAXB Binding (WSDL2Java )- XMLGregorianCalendar to java.util.Date
<jaxws:bindings wsdlLocation="SampleService.wsdl"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<jaxws:bindings node="wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://example.com/service/SampleService/']">
<jxb:globalBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:javaType name="java.util.Date" xmlType="xs:date"
parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime"
printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/>
</jxb:globalBindings>
</jaxws:bindings>
</jaxws:bindings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment