You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2009/06/11 19:31:22 UTC

Re: java.util.Calendar vs. XMLGregorianCalendar - update wsdl2java docs?

OK.  Updated that page with your changes.

Thanks!
Dan


On Thu June 11 2009 1:07:04 pm Bruce Edge wrote:
> Got it working. I put the jxb:binding below in a separate binding file and
> added it to the wsdl2java command line.
>
> I did take out the
>
> <xjc:generateElementProperty>false</xjc:generateElementProperty>
> line though.
> Not entirely sure what that was for.
>
> This doc page is out of date: Apache CXF 2.0 User's Guide - WSDL to
> Java<http://cwiki.apache.org/CXF20DOC/wsdl-to-java.html>
> Should spec
>       <jxb:bindings version="2.0"
> instead of
>       <jxb:bindings version="1.0"
>
> Also, the reference to
>
>   <jxb:bindings schemaLocation="YOUR_SCHEMA_LOCATION" node="/xs:schema">
>
> would be much clearer if it specified that this was a file path requiring
>        <jaxb:bindings  schemaLocation="file:<path><name>.xsd">
> syntax
>
> Is there any other syntax that one can use to specify the location?
>
> From a rookie's point of view it would also be much clearer if it were
> reiterated that these changes belong in a separate binding file. There is
> much assumed in the CXF config docs that make it difficult for the novice.
>
> -Bruce
>
> On Thu, Jun 11, 2009 at 8:03 AM, Bruce Edge <br...@gmail.com> wrote:
> > Viswanath, Thank you very much for your help.
> >
> > I'm still getting generated getter/setters that expect XMLGregorian
> > types. If the wsdl and the xsd where the dateTime element is used are in
> > the same directory I assume that no path prefix is needed?
> >
> > Also, the example in the cxf docs specifies
> >       <jxb:bindings version="1.0"
> > is that out of date?
> >
> > Lastly, what's probably a stupid question, does this snippet belong in
> > the wsdl, or somewhere else?
> >
> > Thanks, Bruce
> >
> >
> > On Wed, Jun 10, 2009 at 11:52 PM, Edumudi, Viswanath <
> >
> > viswanath.edumudi@citi.com> wrote:
> >> <jaxb:bindings version="2.0"
> >>    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
> >>    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
> >>     xmlns:xs="http://www.w3.org/2001/XMLSchema">
> >>     <jaxb:bindings
> >>  schemaLocation="file:..\project_name_in_harddisk\wsdl\XYZ.xsd">
> >>        <jaxb:bindings node="/xs:schema">
> >>            <jaxb:globalBindings>
> >>
> >>  <xjc:generateElementProperty>false</xjc:generateElementProperty>
> >>
> >>                    <jaxb:javaType name="java.util.Calendar"
> >> xmlType="xs:dateTime"
> >>
> >>  parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
> >>
> >>  printMethod="javax.xml.bind.DatatypeConverter.printDateTime"
> >>                    />
> >>                    <jaxb:javaType name="java.util.Calendar"
> >> xmlType="xs:date"
> >>
> >>  parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
> >>
> >>  printMethod="javax.xml.bind.DatatypeConverter.printDate"
> >>                    />
> >>
> >>            </jaxb:globalBindings>
> >>        </jaxb:bindings>
> >>    </jaxb:bindings>
> >> </jaxb:bindings>
> >>
> >> I hope the above code snippet will solve your issue.especially look @
> >> schemaLocation="file:..\project_name_in_harddisk\wsdl\XYZ.xsd"
> >>
> >> -----Original Message-----
> >> From: Bruce Edge [mailto:bruce.edge@gmail.com]
> >> Sent: Wednesday, June 10, 2009 7:17 PM
> >> To: users@cxf.apache.org
> >> Subject: java.util.Calendar vs. XMLGregorianCalendar
> >>
> >> In the config snippet on the wsdl2java docs page,
> >> http://cwiki.apache.org/CXF20DOC/wsdl-to-java.html
> >>
> >> What does the "YOUR_SCHEMA_LOCATION" below refer to?
> >> Is that a local file path or the path relative to the deployment
> >> directory ?
> >>
> >> I assume that "schema" refers to the xsd that uses the xsd:dateTime ?
> >>
> >> <jxb:bindings version="1.0"
> >>              xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
> >>              xmlns:xs="http://www.w3.org/2001/XMLSchema">
> >>  <jxb:bindings schemaLocation="YOUR_SCHEMA_LOCATION" node="/xs: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>
> >>  </jxb:bindings>
> >> </jxb:bindings>
> >>
> >> Thanks, Bruce

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog