Nilupa,

It looks like you are doing a bit more work than you need to do relating to 
the schema stuff.

In:
 public void initialize(ToolContext context) throws ToolException 

you should just need to do:
SchemaCollection schemas = (SchemaCollection) 
context.get(ToolConstants.XML_SCHEMA_COLLECTION);

to get the SchemaCollection that CXF has already parsed, processed, and 
created.  From those, you can get the DOM elements and such.   Thus, you 
shouldn't need to have to deal with the WSDL.

Just a suggestion.  :-)

Dan



On Wednesday 18 August 2010 8:52:25 am Nilupa Bandara wrote:
> On Wed, Aug 18, 2010 at 6:13 PM, Nilupa Bandara
> 
> <nilupa.manamp...@gmail.com>wrote:
> > On Thu, Aug 12, 2010 at 7:43 PM, Daniel Kulp <dk...@apache.org> wrote:
> >> On Thursday 12 August 2010 9:46:51 am Nilupa Bandara wrote:
> >> > Hi,
> >> > 
> >> > I've updated the jibx databinding code to[1] and tested the code
> >> 
> >> generation
> >> 
> >> > with the attached StockQuoteService.wsdl. It generates the proper Java
> >> > classes for the schema embedded in the WSDL, skeleton code of both
> >> 
> >> client
> >> 
> >> > and the server and  proper message exchange happens when JiBX
> >> 
> >> databinding
> >> 
> >> > is set without any problem. At the moment I am writing some test cases
> >> 
> >> and
> >> 
> >> > javadoc comments which I'm hoping to commit in next few days.
> >> 
> >> Super cool.  Nice work.
> > 
> > I've added some tests for testing primitive types. I will add some tests
> > for testing  complex types shortly.
> > 
> > Nilupa
> > 
> >> > There are couple of improvements which I would like to do
> >> > 
> >> > - Support '-compile' option
> >> > 
> >> > If the option is set, JiBX databinding should compile the generated
> >> > Java source files and should run the jibx-binding compiler against
> >> > the
> >> 
> >> generated
> >> 
> >> > class files using the generated binding.xml. Since the jibx-binding
> >> > compiler only accepts class files (not source files) I am thinking 
> >> > how
> >> 
> >> to
> >> 
> >> > compile the generated source files. Is there a standard way of
> >> > programmatically compile source files in Java 5 platform.? (I found
> >> > some web resources illustrating how to do it in Java 6, but couldn't
> >> > find any for Java 5) If there is, then I can enhance the
> >> > JiBXDatabindingTooling
> >> 
> >> to
> >> 
> >> > programmatically compile the generated source files and run the
> >> > jibx-compiler against the those class files when '-compile' option is
> >> 
> >> set.
> >> 
> >> Use our Compiler class:
> >> common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
> >> 
> >> It kind of abstracts out whether it can use the Java6 tool or it has to
> >> fork
> >> out to javac.
> 
> Done .. Now it supports the '-compile' option and the users don't have to
> run the jibx-compiler manually against the generated (user specified)
> binding.xml
> 
> >> > - The implementation of getWrapperType() method in
> >> 
> >> JiBXToolingDataBinding
> >> 
> >> > class looks at the only one (ValueElement) of child elements of
> >> > BindingElement which contains binding/type information of generated
> >> > classes. It can certainly be improved to observe other child elements
> >> > namely StuctElement and CollectionElement when required (see [2]). I
> >> > am looking for some schema/wsdl artifacts which will help me on that
> >> > and it would be great if anyone can point me to such.
> >> 
> >> Well, if you want some very complex things, you could use the type test
> >> wsdl
> >> in testutils:
> >> 
> >> testutils/target/generated/src/main/resources/wsdl/type_test/type_test_d
> >> oclit_soap.wsdl
> >> 
> >> That's probably way overkill though.
> 
> It seems that there are some problems with schema compilation when the root
> schema in the WSDL contains several schema imports. When I ran the jibx
> schema compiler command line feeding the same schema (attached) , it gives
> the same error[1]. I will ask about this issue in  jibx-dev list and see
> whether they suggest any solution.
> 
> Nilupa
> 
> [1] Console output:
> 
>  java -cp jibx-tools.jar  org.jibx.schema.codegen.CodeGen  -t gen/src -w
> type_test_1.xsd
> Loaded and validated 1 specified schema(s)
> Exception in thread "main" java.lang.NullPointerException
> at org.jibx.schema.codegen.SourceBuilder.finish(SourceBuilder.java:327)
>  at org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:211)
> at org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:227)
>  at org.jibx.schema.codegen.CodeGen.buildDataModel(CodeGen.java:1572)
> at org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1779)
>  at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:2202)
> 
> >> Dan
> >> 
> >> > Thanks & Best Regards,
> >> > Nilupa
> >> > 
> >> > 
> >> > 
> >> > [1] http://github.com/nilupa/cxf/tree/trunk/rt/databinding/jibx/
> >> > [2]
> >> 
> >> http://sourceforge.net/mailarchive/message.php?msg_name=4C5CD68B.7070200
> >> %40
> >> 
> >> > sosnoski.com
> >> 
> >> --
> >> Daniel Kulp
> >> dk...@apache.org
> >> http://dankulp.com/blog
> > 
> > --
> > Nilupa Bandara

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

Reply via email to