To Stefan:
Robert's points are valid. Just be
forewarned that the XSB files he mentions contain globally unique identifiers
for schemas and packages that must be referenced from your calling
code. So, if your application 1 necessitates changing code in your
XMLBeans class library, you'll have to re-generate the stub code for
application 1 AND application 2 because re-compiling the schema can result
in a new GUID for that schema and its corresponding package.
Axis2 may have done a better job of
insulating this annoyance but I haven't started using Axis2 yet so I don' t know
for sure.
JT
Someone else may want to comment that has some better knowledge on this.
From: robert lazarski [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 9:25 AM
To: [email protected]
Subject: Re: Generate Java from XSD only
Axis2 is XML Binding independant or at least strives to be. Axis 1 less so. Axis2 has at least adb, xmlbeans and I believe jaxb - all to varying degrees of stability. IMHO is that xmlbeans is currently the most stable in regards to axis2.
Now what xmlbeans does is convert xml to java source files. It also generates xsb files, and also interesting enough for your case, is a class file.
See the axis2 code generation guide - particularly the ant task - for more info.
So in short, I'd bet you could indeed acomplish the first part of the wsdl data binding, ie, the <schema></schema> part, save those .class and .xsb files, and then later reference those to complete the databinding. I don't think that currently exists - you'd have to hack the source a bit.
Keep in mind that axis2 wsdl2java generates skeletons, callbacks, message receivers etc. What you're asking to do I think is to resume that part at a later time. Possible? Probably but not out of the box.
HTH,
Robert
http://www.braziloutsource.com/
On 2/22/06, Stefan Freyr Stefansson <[EMAIL PROTECTED] > wrote:Hello.
I was hoping someone could shed some light on the following issue.
I have to program against two webservices that use datatypes specified by a
third party. These datatypes are specified by XSD's that are publically
available.
So what I'd like to do is to generate the Java classes for the third party
datatypes first, and then generate the Java classes for the two webservices,
referencing the already generated datatypes somehow. I want to do this to
avoid having the same Java classes in two places in my code tree.
I'm working on getting the WSDL for the two webservices changed (these
webservices are not developed on site so it takes a little longer to get such
changes) but the main questions are:
1) How do I generate Java classes from XSD's only with no WSDL referencing
them.
2) How do I generate Java code for the web services and "reference" the
already created Java classes for the datatypes used.
You may be asking why I want to do this and the reason is that I don't want
the code for the two webservices to be put into the same code tree. So, I
basically want three code trees, one for the common datatypes and two more
for the web services code.
Can this be done somehow? Anybody have any pointers as to how it would be
better to do this?
Kind regards, Stefan Freyr.
