Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using xmlbeans bindings for cxf wsdl2java

I am getting started with using apache CXF 2.1.5 and xmlbeans to generate a web service client. The FAQ page shows how to use jaxb bindings to have java.util.Date binding for xsd:dateTime:

<jaxws:bindings wsdlLocation="YOUR_WSDL_LOCATION" 
          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='THE_NAMESPACE_OF_YOUR_SCHEMA']"> 
      <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:dateTime" 
                      parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime" 
                      printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/> 
      </jxb:globalBindings> 
  </jaxws:bindings> 
</jaxws:bindings> 

I want to use xmlBeans bindings instead but can't find a suitable example. I understand how to use xmlbeans to map an xml file to java object but I can't find the syntax to use cxf. Any pointers, code samples are welcome.

like image 314
Bala Avatar asked Nov 06 '22 20:11

Bala


1 Answers

There is a sample project integrating XBean:

http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/samples/wsdl_first_xmlbeans/

like image 157
user409438 Avatar answered Nov 12 '22 20:11

user409438