You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by stug23 <pa...@gmail.com> on 2009/12/05 19:02:08 UTC

Re: AW: Problem with code generation and binding files

I am on a project that is considering a switch to Apache CXF from Sun JAXWS.

For a while I have been following developments for CXF and have noted that
support for JAXB episode seems to be still in a formative stage. Is there a
document for the WSDL-to-Java Maven plugin for CXF that describes each
configuration parameter, especially how to pass arguments to JAXB for
episodes and/or JAXB plugins?

A helpful posting on what episodes are and how they are used can be found
here:

  <http://weblogs.java.net/blog/2006/09/05/separate-compilation-jaxb-ri-21>

Thanks




dkulp wrote:
> 
> On Sun July 5 2009 7:53:46 pm johannes.konstantinidis@capgemini-sdm.com
> wrote:
>> Hello,
>>
>> does anybody have an idea?
>> My problem still exists.
> 
> As Benson stated, a JIRA with a reproducible test case would be great.  
> I've 
> heard of issues with episode files before as well, but I've never used an 
> episode file so I really don't know enough to dig in without some sort of 
> test. 
> 
> Dan
> 
> 
>>
>> Thanks
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Konstantinidis, Johannes
>> Gesendet: Dienstag, 23. Juni 2009 19:15
>> An: users@cxf.apache.org
>> Betreff: Problem with code generation and binding files
>>
>> Hello,
>>
>> I have a problem with the generation of the CXF classes when the JAXB
>> classes have been generated before via separate compilation with episode
>> files.
>>
>> I have a WSDL (service.wsdl) which imports a xml schema (service.xsd)
>> that
>> defines all types for service invocation. In addition I have a xml schema
>> with some basic types (common.xsd) which is imported by service.xsd.
>>
>> The whole generation takes place in one build within one project. No
>> compilation is performed between the different steps.
>>
>> At first I generate the JAXB classes for service.xsd and common.xsd with
>> the JAXB Maven Plugin (org.jvnet.jaxb2/maven2.maven-jaxb2-plugin). Now I
>> have the classes and the two episode files for them.
>>
>> Now I would like to generate the CXF classes with the Maven Plugin
>> (org.apache.cxf/ cxf-codegen-plugin).
>>
>> <wsdlOption>
>>  <wsdl>src/main/resources/service.wsdl</wsdl>
>>  <bindingFiles>
>>    
>> <bindingFile>${project.build.directory}/generated-sources/xjc/common.episod
>>e</bindingFile>
>> <bindingFile>${project.build.directory}/generated-sources/xjc/service.episo
>>de</bindingFile> </bindingFiles>
>>  <extraargs>
>>   <extraarg>-impl</extraarg>
>>   <extraarg>-server</extraarg>
>>   <extraarg>-validate</extraarg>
>>  </extraargs>
>> </wsdlOption>
>>
>> That results in an error message: Failed to create java parameter for
>> part
>> [test] in method [test] It seems that the generator can not retrieve the
>> class name of test although it is specified within the corresponding
>> episode file. Btw, I tested the wsdl with the wsdlvalidator tool.
>>
>> When I try to specify some package names in addition to the binding files
>>
>>  <packagenames>
>>    
>> <package>http://my.example.com/WSDLNamespace=my.example.com.ws</package>
>> <package>http://my.example.com/Service=my.example.com.ws.service</package>
>> <package>http://my.example.com/Common=my.example.com.ws.common</package>
>> </packagenames>
>>
>> I get an error
>> Thrown by JAXB : Multiple <schemaBindings> are defined for the target
>> namespace http://my.example.com/Service at line 5 column 22 of schema  
>> temporary xsd file>
>>
>> What is my fault?
>> Btw: Is it possible not to delete the temporary xsd file just to get more
>> information about problem?
>>
>> Thanks for your help!
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://old.nabble.com/Problem-with-code-generation-and-binding-files-tp24170728p26657819.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: AW: Problem with code generation and binding files

Posted by Andreas Veithen <an...@gmail.com>.
I played with episode files this weekend and they work very well, as
long as you don't use inline JAXB customizations in your schemas
(because they will conflict with the bindings in the episode file). I
did that with the tooling from JAX-WS RI (see attached POM file), but
it should be similar for CXF. You only need to be able to pass
additional arguments to xjc. There are actually two ways to achieve
this:

- Pass the path to the JAR file containing the episode as argument to
xjc. This is the option that I used.
- Extract the sun-jaxb.episode file and configure it as JAXB binding
file. This should work because the episode file is a JAXB binding
file.

It should definitely be possible to use one of these approaches with
the CXF Maven plugins.

Andreas

On Mon, Dec 7, 2009 at 18:54, Daniel Kulp <dk...@apache.org> wrote:
> On Sat December 5 2009 1:02:08 pm stug23 wrote:
>> I am on a project that is considering a switch to Apache CXF from Sun
>> �JAXWS.
>
> Cool. � Please let us know of your impressions on how easy/hard the switch is.
> With CXF being JAXWS compliant, it SHOULDN'T be too hard for most use cases,
> but I'm always interested in hearing how it worked out for people.
>
>
>> For a while I have been following developments for CXF and have noted that
>> support for JAXB episode seems to be still in a formative stage. Is there a
>> document for the WSDL-to-Java Maven plugin for CXF that describes each
>> configuration parameter, especially how to pass arguments to JAXB for
>> episodes and/or JAXB plugins?
>
> Some info at:
> http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html
> http://cxf.apache.org/docs/wsdl-to-java.html
>
>
>
>> A helpful posting on what episodes are and how they are used can be found
>> here:
>>
>> � <http://weblogs.java.net/blog/2006/09/05/separate-compilation-jaxb-ri-21>
>
> I've never really had time to look into episode files. � I know very little
> about them. �There have been reports of them not working for some people, but
> when I asked for a sample test case, all I got was silence which I never
> figured out if it means they got it working or they gave up. � �Please let me
> know how your experiments work out. � I'd really like to know if they do or do
> not work. � :-)
>
> On a cxf development note, I've THOUGHT about adding an episode file into cxf-
> api for all the stuff that we have code generated into there. � �That COULD
> simplify some of the stuff we do in later phases of the build.
>
> Dan
>
>
>
>>
>> Thanks
>>
>> dkulp wrote:
>> > On Sun July 5 2009 7:53:46 pm johannes.konstantinidis@capgemini-sdm.com
>> >
>> > wrote:
>> >> Hello,
>> >>
>> >> does anybody have an idea?
>> >> My problem still exists.
>> >
>> > As Benson stated, a JIRA with a reproducible test case would be great.
>> > I've
>> > heard of issues with episode files before as well, but I've never used an
>> > episode file so I really don't know enough to dig in without some sort of
>> > test.
>> >
>> > Dan
>> >
>> >> Thanks
>> >>
>> >>
>> >> -----Urspr�ngliche Nachricht-----
>> >> Von: Konstantinidis, Johannes
>> >> Gesendet: Dienstag, 23. Juni 2009 19:15
>> >> An: users@cxf.apache.org
>> >> Betreff: Problem with code generation and binding files
>> >>
>> >> Hello,
>> >>
>> >> I have a problem with the generation of the CXF classes when the JAXB
>> >> classes have been generated before via separate compilation with episode
>> >> files.
>> >>
>> >> I have a WSDL (service.wsdl) which imports a xml schema (service.xsd)
>> >> that
>> >> defines all types for service invocation. In addition I have a xml
>> >> schema with some basic types (common.xsd) which is imported by
>> >> service.xsd.
>> >>
>> >> The whole generation takes place in one build within one project. No
>> >> compilation is performed between the different steps.
>> >>
>> >> At first I generate the JAXB classes for service.xsd and common.xsd with
>> >> the JAXB Maven Plugin (org.jvnet.jaxb2/maven2.maven-jaxb2-plugin). Now I
>> >> have the classes and the two episode files for them.
>> >>
>> >> Now I would like to generate the CXF classes with the Maven Plugin
>> >> (org.apache.cxf/ cxf-codegen-plugin).
>> >>
>> >> <wsdlOption>
>> >> �<wsdl>src/main/resources/service.wsdl</wsdl>
>> >> �<bindingFiles>
>> >>
>> >> <bindingFile>${project.build.directory}/generated-sources/xjc/common.epi
>> >>sod e</bindingFile>
>> >> <bindingFile>${project.build.directory}/generated-sources/xjc/service.ep
>> >>iso de</bindingFile> </bindingFiles>
>> >> �<extraargs>
>> >> � <extraarg>-impl</extraarg>
>> >> � <extraarg>-server</extraarg>
>> >> � <extraarg>-validate</extraarg>
>> >> �</extraargs>
>> >> </wsdlOption>
>> >>
>> >> That results in an error message: Failed to create java parameter for
>> >> part
>> >> [test] in method [test] It seems that the generator can not retrieve the
>> >> class name of test although it is specified within the corresponding
>> >> episode file. Btw, I tested the wsdl with the wsdlvalidator tool.
>> >>
>> >> When I try to specify some package names in addition to the binding
>> >> files
>> >>
>> >> �<packagenames>
>> >>
>> >> <package>http://my.example.com/WSDLNamespace=my.example.com.ws</package>
>> >> <package>http://my.example.com/Service=my.example.com.ws.service</packag
>> >>e>
>> >> <package>http://my.example.com/Common=my.example.com.ws.common</package>
>> >> </packagenames>
>> >>
>> >> I get an error
>> >> Thrown by JAXB : Multiple <schemaBindings> are defined for the target
>> >> namespace http://my.example.com/Service at line 5 column 22 of schema
>> >> temporary xsd file>
>> >>
>> >> What is my fault?
>> >> Btw: Is it possible not to delete the temporary xsd file just to get
>> >> more information about problem?
>> >>
>> >> Thanks for your help!
>>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Re: AW: Problem with code generation and binding files

Posted by stug23 <pa...@gmail.com>.
I'm just getting started with the proposed switch so it will probably be a
while before all of the issues (if any) are known.

I am already much more impressed with the Maven build quality of the CXF
solution when compared to the Sun JAXWS which has been a challenge from the
start. The worse thing I found was Metro which conjoins many jar files into
a few so that dependencies/version are no longer well identified.

Also currently we've had trouble getting the Sun Maven jaxws plugin to
behave (i.e., work) in Java 6, however Apache CXF worked immediately in Java
6.



dkulp wrote:
> 
> On Sat December 5 2009 1:02:08 pm stug23 wrote:
>> I am on a project that is considering a switch to Apache CXF from Sun
>>  JAXWS.
> 
> Cool.   Please let us know of your impressions on how easy/hard the switch
> is.   
> With CXF being JAXWS compliant, it SHOULDN'T be too hard for most use
> cases, 
> but I'm always interested in hearing how it worked out for people.
> 
> 
>> For a while I have been following developments for CXF and have noted
>> that
>> support for JAXB episode seems to be still in a formative stage. Is there
>> a
>> document for the WSDL-to-Java Maven plugin for CXF that describes each
>> configuration parameter, especially how to pass arguments to JAXB for
>> episodes and/or JAXB plugins?
> 
> Some info at:
> http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html
> http://cxf.apache.org/docs/wsdl-to-java.html
> 
> 
> 
>> A helpful posting on what episodes are and how they are used can be found
>> here:
>> 
>>  
>> <http://weblogs.java.net/blog/2006/09/05/separate-compilation-jaxb-ri-21>
> 
> I've never really had time to look into episode files.   I know very
> little 
> about them.  There have been reports of them not working for some people,
> but 
> when I asked for a sample test case, all I got was silence which I never 
> figured out if it means they got it working or they gave up.    Please let
> me 
> know how your experiments work out.   I'd really like to know if they do
> or do 
> not work.   :-)
> 
> On a cxf development note, I've THOUGHT about adding an episode file into
> cxf-
> api for all the stuff that we have code generated into there.    That
> COULD 
> simplify some of the stuff we do in later phases of the build.    
> 
> Dan
> 
> 
> 
>> 
>> Thanks
>> 
>> dkulp wrote:
>> > On Sun July 5 2009 7:53:46 pm johannes.konstantinidis@capgemini-sdm.com
>> >
>> > wrote:
>> >> Hello,
>> >>
>> >> does anybody have an idea?
>> >> My problem still exists.
>> >
>> > As Benson stated, a JIRA with a reproducible test case would be great.
>> > I've
>> > heard of issues with episode files before as well, but I've never used
>> an
>> > episode file so I really don't know enough to dig in without some sort
>> of
>> > test.
>> >
>> > Dan
>> >
>> >> Thanks
>> >>
>> >>
>> >> -----Ursprüngliche Nachricht-----
>> >> Von: Konstantinidis, Johannes
>> >> Gesendet: Dienstag, 23. Juni 2009 19:15
>> >> An: users@cxf.apache.org
>> >> Betreff: Problem with code generation and binding files
>> >>
>> >> Hello,
>> >>
>> >> I have a problem with the generation of the CXF classes when the JAXB
>> >> classes have been generated before via separate compilation with
>> episode
>> >> files.
>> >>
>> >> I have a WSDL (service.wsdl) which imports a xml schema (service.xsd)
>> >> that
>> >> defines all types for service invocation. In addition I have a xml
>> >> schema with some basic types (common.xsd) which is imported by
>> >> service.xsd.
>> >>
>> >> The whole generation takes place in one build within one project. No
>> >> compilation is performed between the different steps.
>> >>
>> >> At first I generate the JAXB classes for service.xsd and common.xsd
>> with
>> >> the JAXB Maven Plugin (org.jvnet.jaxb2/maven2.maven-jaxb2-plugin). Now
>> I
>> >> have the classes and the two episode files for them.
>> >>
>> >> Now I would like to generate the CXF classes with the Maven Plugin
>> >> (org.apache.cxf/ cxf-codegen-plugin).
>> >>
>> >> <wsdlOption>
>> >>  <wsdl>src/main/resources/service.wsdl</wsdl>
>> >>  <bindingFiles>
>> >>
>> >>
>> <bindingFile>${project.build.directory}/generated-sources/xjc/common.epi
>> >>sod e</bindingFile>
>> >>
>> <bindingFile>${project.build.directory}/generated-sources/xjc/service.ep
>> >>iso de</bindingFile> </bindingFiles>
>> >>  <extraargs>
>> >>   <extraarg>-impl</extraarg>
>> >>   <extraarg>-server</extraarg>
>> >>   <extraarg>-validate</extraarg>
>> >>  </extraargs>
>> >> </wsdlOption>
>> >>
>> >> That results in an error message: Failed to create java parameter for
>> >> part
>> >> [test] in method [test] It seems that the generator can not retrieve
>> the
>> >> class name of test although it is specified within the corresponding
>> >> episode file. Btw, I tested the wsdl with the wsdlvalidator tool.
>> >>
>> >> When I try to specify some package names in addition to the binding
>> >> files
>> >>
>> >>  <packagenames>
>> >>
>> >>
>> <package>http://my.example.com/WSDLNamespace=my.example.com.ws</package>
>> >>
>> <package>http://my.example.com/Service=my.example.com.ws.service</packag
>> >>e>
>> >>
>> <package>http://my.example.com/Common=my.example.com.ws.common</package>
>> >> </packagenames>
>> >>
>> >> I get an error
>> >> Thrown by JAXB : Multiple <schemaBindings> are defined for the target
>> >> namespace http://my.example.com/Service at line 5 column 22 of schema
>> >> temporary xsd file>
>> >>
>> >> What is my fault?
>> >> Btw: Is it possible not to delete the temporary xsd file just to get
>> >> more information about problem?
>> >>
>> >> Thanks for your help!
>> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://old.nabble.com/Problem-with-code-generation-and-binding-files-tp24170728p26704653.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: AW: Problem with code generation and binding files

Posted by Daniel Kulp <dk...@apache.org>.
On Sat December 5 2009 1:02:08 pm stug23 wrote:
> I am on a project that is considering a switch to Apache CXF from Sun
>  JAXWS.

Cool.   Please let us know of your impressions on how easy/hard the switch is.   
With CXF being JAXWS compliant, it SHOULDN'T be too hard for most use cases, 
but I'm always interested in hearing how it worked out for people.


> For a while I have been following developments for CXF and have noted that
> support for JAXB episode seems to be still in a formative stage. Is there a
> document for the WSDL-to-Java Maven plugin for CXF that describes each
> configuration parameter, especially how to pass arguments to JAXB for
> episodes and/or JAXB plugins?

Some info at:
http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html
http://cxf.apache.org/docs/wsdl-to-java.html



> A helpful posting on what episodes are and how they are used can be found
> here:
> 
>   <http://weblogs.java.net/blog/2006/09/05/separate-compilation-jaxb-ri-21>

I've never really had time to look into episode files.   I know very little 
about them.  There have been reports of them not working for some people, but 
when I asked for a sample test case, all I got was silence which I never 
figured out if it means they got it working or they gave up.    Please let me 
know how your experiments work out.   I'd really like to know if they do or do 
not work.   :-)

On a cxf development note, I've THOUGHT about adding an episode file into cxf-
api for all the stuff that we have code generated into there.    That COULD 
simplify some of the stuff we do in later phases of the build.    

Dan



> 
> Thanks
> 
> dkulp wrote:
> > On Sun July 5 2009 7:53:46 pm johannes.konstantinidis@capgemini-sdm.com
> >
> > wrote:
> >> Hello,
> >>
> >> does anybody have an idea?
> >> My problem still exists.
> >
> > As Benson stated, a JIRA with a reproducible test case would be great.
> > I've
> > heard of issues with episode files before as well, but I've never used an
> > episode file so I really don't know enough to dig in without some sort of
> > test.
> >
> > Dan
> >
> >> Thanks
> >>
> >>
> >> -----Ursprüngliche Nachricht-----
> >> Von: Konstantinidis, Johannes
> >> Gesendet: Dienstag, 23. Juni 2009 19:15
> >> An: users@cxf.apache.org
> >> Betreff: Problem with code generation and binding files
> >>
> >> Hello,
> >>
> >> I have a problem with the generation of the CXF classes when the JAXB
> >> classes have been generated before via separate compilation with episode
> >> files.
> >>
> >> I have a WSDL (service.wsdl) which imports a xml schema (service.xsd)
> >> that
> >> defines all types for service invocation. In addition I have a xml
> >> schema with some basic types (common.xsd) which is imported by
> >> service.xsd.
> >>
> >> The whole generation takes place in one build within one project. No
> >> compilation is performed between the different steps.
> >>
> >> At first I generate the JAXB classes for service.xsd and common.xsd with
> >> the JAXB Maven Plugin (org.jvnet.jaxb2/maven2.maven-jaxb2-plugin). Now I
> >> have the classes and the two episode files for them.
> >>
> >> Now I would like to generate the CXF classes with the Maven Plugin
> >> (org.apache.cxf/ cxf-codegen-plugin).
> >>
> >> <wsdlOption>
> >>  <wsdl>src/main/resources/service.wsdl</wsdl>
> >>  <bindingFiles>
> >>
> >> <bindingFile>${project.build.directory}/generated-sources/xjc/common.epi
> >>sod e</bindingFile>
> >> <bindingFile>${project.build.directory}/generated-sources/xjc/service.ep
> >>iso de</bindingFile> </bindingFiles>
> >>  <extraargs>
> >>   <extraarg>-impl</extraarg>
> >>   <extraarg>-server</extraarg>
> >>   <extraarg>-validate</extraarg>
> >>  </extraargs>
> >> </wsdlOption>
> >>
> >> That results in an error message: Failed to create java parameter for
> >> part
> >> [test] in method [test] It seems that the generator can not retrieve the
> >> class name of test although it is specified within the corresponding
> >> episode file. Btw, I tested the wsdl with the wsdlvalidator tool.
> >>
> >> When I try to specify some package names in addition to the binding
> >> files
> >>
> >>  <packagenames>
> >>
> >> <package>http://my.example.com/WSDLNamespace=my.example.com.ws</package>
> >> <package>http://my.example.com/Service=my.example.com.ws.service</packag
> >>e>
> >> <package>http://my.example.com/Common=my.example.com.ws.common</package>
> >> </packagenames>
> >>
> >> I get an error
> >> Thrown by JAXB : Multiple <schemaBindings> are defined for the target
> >> namespace http://my.example.com/Service at line 5 column 22 of schema
> >> temporary xsd file>
> >>
> >> What is my fault?
> >> Btw: Is it possible not to delete the temporary xsd file just to get
> >> more information about problem?
> >>
> >> Thanks for your help!
> 

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