Freigeben über


Need a good XSD-to-Java class generator

So far I've tried Castor and I've tried XBeans.  Two more downloads, and once again I'm reminded that every class in Java must exist in its own file.  The result of trying to use Castor to generate code from an XSD that describes two complex types?  Four class files ... one for each complex type definition and one for each top-level element that is of one of the given complex types.  I haven't got XBeans working yet as I've got some issue with my CLASSPATH at the moment.

Why do I want an XSD-to-Java class generator?  I'm a firm beleiver in message-first design for Web services.  While it doesn't guarentee interoperability as there are still some wierd differences between Java and .NET (i.e, datetime's are reference types in Java and value types in .NET, the former which can be nillable and the later which complains if they are), it does make it possible for both sides to share the same base definition of the messages we want to send back and forth.

So, while I have the capability right now to cons up any Java class I want and have Axis 1.2 alpha serialize the class to XML, I don't trust myself to create Java classes that are compatible with .NET.  Gimme a shout if anyone has some good guidance!

Comments

  • Anonymous
    September 30, 2004
    The comment has been removed
  • Anonymous
    September 30, 2004
    Did you try XmlSpy's code generation feature? Honestly, I do not know a lot about its quality. And I think there is also a tool in the Axis package.
    Finally, I hope on the .NET side you use this tool:
    http://www.thinktecture.com/resources/software/wscontractfirst/default.html
    ;)

    Cheers,
    Christian
  • Anonymous
    September 30, 2004
    Hello --

    I think JAXB is what you are looking for.

    IBM's Eclipse foundation has something called EMF which is actually really good, but sounds more complicated than you need.
  • Anonymous
    February 06, 2006
    The comment has been removed