You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Nilupa Bandara <ni...@gmail.com> on 2010/08/12 15:46:51 UTC

JiBX DataBinding: Status Update

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.

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.

- 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.

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%40sosnoski.com
-- 
Nilupa Bandara

Re: JiBX DataBinding: Status Update

Posted by Nilupa Bandara <ni...@gmail.com>.
On Wed, Aug 18, 2010 at 11:48 PM, Daniel Kulp <dk...@apache.org> wrote:

>
> 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.  :-)
>

Yes .. it makes sense to do obtain schemas as suggested since it avoid
having to deal with WSDL. Thanks for the pointer and I will fix and update
the repository shortly.

Thanks,
Nilupa


>
> Dan
>
>
>
> On Wednesday 18 August 2010 8:52:25 am Nilupa Bandara wrote:
> > On Wed, Aug 18, 2010 at 6:13 PM, Nilupa Bandara
> >
> > <ni...@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
> > >> dkulp@apache.org
> > >> http://dankulp.com/blog
> > >
> > > --
> > > Nilupa Bandara
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>



-- 
Nilupa Bandara

Re: JiBX DataBinding: Status Update

Posted by Daniel Kulp <dk...@apache.org>.
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
> 
> <ni...@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
> >> dkulp@apache.org
> >> http://dankulp.com/blog
> > 
> > --
> > Nilupa Bandara

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

Re: JiBX DataBinding: Status Update

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday 24 August 2010 8:31:21 am Dennis Sosnoski wrote:
> On 08/19/2010 06:00 AM, Daniel Kulp wrote:
> > ...
> > So, to actually integrate it, we would need to either have it in a proper
> > maven 2 snapshot repo or get a usable release.   That's obviously outside
> > the scope for the GSoC project though.   Kind of falls on Dennis. :-)
> 
> We've tried in the past to set up maven2 snapshot publication, but
> haven't found a way to do that. If you can point me in the right
> direction I'll see what I can do.

Well, using Maven to build is usually the easiest.   :-)

How are the releases pushed into central?  It should be similar to that I 
would assume, just a different directory.   The main thing is the directory 
structure would need to be the same.   "org/jibx/*/1.2.3-SNAPSHOT/..."

> I'll also do my best to get the official JiBX 1.2.3 release out next
> week, including the hooks Nilupa is using. I'm actually going to make
> one change to the org.jibx.binding.model.BindingUtils.getDefinitions()
> method you're using, Nilupa, to return JiBX binding definition <format>
> elements for schema simpleTypes, so that the CXF code can make use of
> these conversions in the future.

Cool.  Once that gets pushed to Central, we may be all set.

Thanks!
Dan



> 
>   - Dennis

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

Re: JiBX DataBinding: Status Update

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
On 08/19/2010 06:00 AM, Daniel Kulp wrote:
> ...
> So, to actually integrate it, we would need to either have it in a proper 
> maven 2 snapshot repo or get a usable release.   That's obviously outside the 
> scope for the GSoC project though.   Kind of falls on Dennis. :-)
>   

We've tried in the past to set up maven2 snapshot publication, but
haven't found a way to do that. If you can point me in the right
direction I'll see what I can do.

I'll also do my best to get the official JiBX 1.2.3 release out next
week, including the hooks Nilupa is using. I'm actually going to make
one change to the org.jibx.binding.model.BindingUtils.getDefinitions()
method you're using, Nilupa, to return JiBX binding definition <format>
elements for schema simpleTypes, so that the CXF code can make use of
these conversions in the future.

  - Dennis

Re: JiBX DataBinding: Status Update

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 18 August 2010 1:38:29 pm Nilupa Bandara wrote:
> On Wed, Aug 18, 2010 at 9:50 PM, Daniel Kulp <dk...@apache.org> wrote:
> > Nilupa, (and Dennis)
> > 
> > Are the jibx snapshot's available in a maven snapshot repo someplace?   I
> > see
> > the latest releases are on central and such, but I didn't see a snapshot
> > repo
> > anywhere.
> 
> Following is the maven1 repository Dennis pointed out sometime back;
> http://jibx.sourceforge.net/maven/jibx/jars/
> 
> Nilupa
> <http://jibx.sourceforge.net/maven/jibx/jars/>

That actually doesn't help at all for two reasons:

1) it would exclude using Maven 3 as Maven 3 doesn't support the old maven 1 
repository layout anymore.

2) It's not setup correctly anyway.  We have the dep defined as org.jibx 
groupId, but that isn't how the file exists in that location.   Thus, it 
wouldn't be found with maven 2 either.

So, to actually integrate it, we would need to either have it in a proper 
maven 2 snapshot repo or get a usable release.   That's obviously outside the 
scope for the GSoC project though.   Kind of falls on Dennis. :-)


Dan


 
> > I'd like to start trying to get it merged into the main repo (probably
> > not enabled by default right now), but the artifacts would need to be
> > resolvable
> > somehow.
> > 
> > 
> > Dan
> > 
> > On Wednesday 18 August 2010 8:52:25 am Nilupa Bandara wrote:
> > > On Wed, Aug 18, 2010 at 6:13 PM, Nilupa Bandara
> > > 
> > > <ni...@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
> > > >> dkulp@apache.org
> > > >> http://dankulp.com/blog
> > > > 
> > > > --
> > > > Nilupa Bandara
> > 
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog

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

Re: JiBX DataBinding: Status Update

Posted by Daniel Kulp <dk...@apache.org>.
Nilupa, (and Dennis)

Are the jibx snapshot's available in a maven snapshot repo someplace?   I see 
the latest releases are on central and such, but I didn't see a snapshot repo 
anywhere.

I'd like to start trying to get it merged into the main repo (probably not 
enabled by default right now), but the artifacts would need to be resolvable 
somehow.


Dan



On Wednesday 18 August 2010 8:52:25 am Nilupa Bandara wrote:
> On Wed, Aug 18, 2010 at 6:13 PM, Nilupa Bandara
> 
> <ni...@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
> >> dkulp@apache.org
> >> http://dankulp.com/blog
> > 
> > --
> > Nilupa Bandara

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

Re: JiBX DataBinding: Status Update

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
On 08/19/2010 12:52 AM, Nilupa Bandara wrote:
>
>
>
>         > - 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_doclit_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.
>

I'll take a look at this problem, Nilupa. Can you create a JiBX Jira
with attachments to make it easy for me to replicate?

That aside, I think you've been focused on code generation at the time
the CXF tool is being run. We're also going to need to also work with
pre-existing JiBX bindings, which is why I set up the JiBX methods
you're using to work both ways. So you'll need to have an option to get
one or more pre-existing JiBX binding definitions as input, and be able
to pass those in to the JiBX code generation so it knows what it's
starting from.

I gather you've also been focused mainly on wrapped style WSDLs. This is
certainly a major use case, but a lot of organizations are also using
plain doc/lit where the message elements have complex XML structure. The
OTA schemas used by the JiBX/OTA subproject
(http://jibx.sourceforge.net/jibxota/index.html) are a good example of
this. The subproject includes Ant scripts to first use CodeGen to
generate code and JiBX bindings from the schemas (either as a single
lump build, or with modular builds where classes corresponding to the
various groups of schemas are separately bound and bundled into separate
jars). Once you've build the data model, you can then generate a WSDL
from a code-first sample, and finally deploy that as a web service using
either Axis2 or JiBX/WS. I'd love to include a CXF deployment example
with this.

So in this case, you'd need to take a supplied WSDL (which was
generated, though there's no reason you'd need to care about that) and
corresponding binding definitions, and just link the message elements
referenced by the WSDL to the corresponding classes. Should be pretty
easy, but it represents a different path through your code.

  - Dennis

Re: JiBX DataBinding: Status Update

Posted by Nilupa Bandara <ni...@gmail.com>.
On Wed, Aug 18, 2010 at 6:13 PM, Nilupa Bandara
<ni...@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_doclit_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
>> dkulp@apache.org
>> http://dankulp.com/blog
>>
>
>
>
> --
> Nilupa Bandara
>
>


-- 
Nilupa Bandara

Re: JiBX DataBinding: Status Update

Posted by Nilupa Bandara <ni...@gmail.com>.
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.
>
>
> > - 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_doclit_soap.wsdl
>
> That's probably way overkill though.
>
> 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
> dkulp@apache.org
> http://dankulp.com/blog
>



-- 
Nilupa Bandara

Re: JiBX DataBinding: Status Update

Posted by Daniel Kulp <dk...@apache.org>.
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.


> 
> 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.    


> - 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_doclit_soap.wsdl

That's probably way overkill though.   

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
dkulp@apache.org
http://dankulp.com/blog