Cxf full contact (8)-convert xmlgregoriancalendar to date when wsdl2java is used

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.