You need to create a customer binding file for your web service. You can 
use the following as a guide but change the relevant information to your 
specific needs.
For example: wsldLoction needs to be your services URL, and the 
targetNamespace must match your services namespace.

<jaxws:bindings 
wsdlLocation="http://localhost:8080/applicationContext/services/serviceName?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:[EMAIL 
PROTECTED]'http://your.service.namespace.com']">
      <jxb:globalBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
        <jxb:serializable/>
        <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>


Next, you need to tell wsdl2java about the binding. For example:
.\wsdl2java.bat -client -d s:\cxf-client\src -b 
s:\cxf-client\yourServiceBinding.xml -validate 
http://localhost:8080/applicationContext/services/serviceName?wsdl

wsdl2java will then apply the binding to your generated classes.

I hope this helps...

Chris 




"Cord Awtry" <[EMAIL PROTECTED]> 
05/19/2008 11:49 AM
Please respond to
[email protected]


To
[email protected]
cc

Subject
dateTime custom binding






Hello all,

  Wondering if someone can lend some advice on an issue I'm seeing (may 
not
even be an issue, I'm open to that as an answer ;) ). Essentially, I have 
a
WSDL being generated by CXF with all my types inline. I have a bunch of
xs:datetime objects which are being converted to XMLGregorianCalendar when 
I
run wsdlToJava. I've done a bunch of research on this, seen several
solutions and have yet to see anything work. I've copied the code from the
cwiki for solving this, but still no resolution. It's possible what I view
as the proper resolution may be incorrect. Essentially, I'd like to get 
rid
of all the instances of XMLGregorianCalendar in my generated java files 
and
have them be java.util.Date objects. Below is a copy of my bindings that 
I'm
using with CXF 2.1. If anyone has any thoughts as to why I'm still getting
XMLGregorianCalendar objects in my generated java files, I'd be more than
happy to hear it.

  Thanks,

    -C-

<jaxws:bindings wsdlLocation="
http://127.0.0.1:8080/ext/services/Extension?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:[EMAIL PROTECTED]'
http://www.tmu.com/services/Extension/2008/05']">
    <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>

Reply via email to