Use the wsdl2java command to generate JavaCodeSee:
Http://blog.csdn.net/kunshan_shenbin/archive/2009/02/10/3873049.aspx
In the generated code by default, all the date types are converted to the xmlgregoriancalendar type.
Use the-B parameter of wsdl2java to specify the configuration file that can be replaced.
The configuration file is as follows:
Jaxb-binding-date.xml
<Jaxws: bindings <br/> xmlns: jaxws = "http://java.sun.com/xml/ns/jaxws" <br/> xmlns: xs = "http://www.w3.org/2001/XMLSchema" <br/> xmlns: jxb = "http://java.sun.com/xml/ns/jaxb" <br/> xmlns: WSDL = "http://schemas.xmlsoap.org/wsdl/"> <br/> <jaxws: bindings node = "WSDL: Definitions/WSDL: types/Xs: schema [@ targetnamespace = 'HTTP: // service.test.com/'] "> <br/> <jxb: globalbindings xmlns: jxb =" http://java.sun.com/xml/ns/jaxb "xmlns: xs = "http://www.w3.org/2001/XMLSchema"> <br/> <jxb: javatype name = "Java. util. date "xmltype =" XS: datetime "<br/> parsemethod =" org. apache. cxf. tools. common. datatypeadapter. parsedatetime "<br/> printmethod =" org. apache. cxf. tools. common. datatypeadapter. printdatetime "/> <br/> </jxb: globalbindings> <br/> </jaxws: bindings>
Note:Http://service.test.com/Replace it with your own namespace.
The command format is as follows:
Wsdl2java-B jaxb-binding-date.xml http: // localhost: 8080/cxfservice/services/XXXXX? WSDL