cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-4202) Maven-codegin-plugin ignores option "frontend" if there is more than one wsdl file
Date Mon, 26 Mar 2012 14:40:29 GMT

    [ https://issues.apache.org/jira/browse/CXF-4202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238437#comment-13238437
] 

Daniel Kulp commented on CXF-4202:
----------------------------------


This is "working as designed", but it's unfortunate that we cannot get Maven to flag the problem
in the config.   The wsdlOption only allows a single "<wsdl>" element in there and thus
will only apply to one of them (not sure if maven uses the first or the last).   What is happening
is that the plugin scans the src/main/resources/wsdl to get a list of wsdl's to process, then
uses the wsdlOptions to apply options to specific wsdl's mentioned there.   In your case,
it would only apply to one of them.   You have two options:

1) Specify multiple 'wdlOption' elements, one for each wsdl you would like to process

2) Use the "defaultOptions" tag to mark things to apply to all wsdls:

{code}
<configuration>
    <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
    <defaultOptions>
       <extraargs>
       <extraarg>-frontend</extraarg>
       <extraarg>jaxws21</extraarg>
       <extraarg>-xjc-Xts</extraarg>
       <extraarg>-xjc-Xdv</extraarg>
     </extraargs>
    </defaultOptions>
</configuration>
{code}

HOWEVER, I should also note that there are specific option flags for those, and thus you should
likely use:

<configuration>
    <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
    <defaultOptions>
       <frontEnd>jaxws21</frontEnd>
       <xjcargs>
          <arg>-xjc-Xts</arg>
          <arg>-xjc-Xdv</arg>
       </xjcargs>
    </defaultOptions>
</configuration>
{code}


                
> Maven-codegin-plugin ignores option "frontend" if there is more than one wsdl file
> ----------------------------------------------------------------------------------
>
>                 Key: CXF-4202
>                 URL: https://issues.apache.org/jira/browse/CXF-4202
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.5.2
>         Environment: Ubuntu 11.10, Eclipse 3.6.2 (classic), m2e plugin version 0.12.1.20110112-1712,
maven-codegen-plugin version 2.5.2
>            Reporter: Jose Eduardo Slompo
>            Assignee: Freeman Fang
>            Priority: Minor
>              Labels: codegen, frontend, maven, wsdl2java
>
> If we have more than one WSDL file for the execution of maven-codegen-plugin and we specify
the extraargs "frontend" and "jaxws21", only one of the WSDL generates JAXWS21 compliant Java
files.
> POM.XML:
> --------
> <plugin>
> 	<groupId>org.apache.cxf</groupId>
> 	<artifactId>cxf-codegen-plugin</artifactId>
> 	<version>2.5.2.</version>
> 	<executions>
> 		<execution>
> 			<id>generate-wsdl-stubs</id>
> 			<phase>generate-sources</phase>
> 			<configuration>
> 				<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
> 				<wsdlOptions>
> 					<wsdlOption>
> 						<wsdl>${basedir}/src/main/resources/wsdl/ServiceONE.wsdl</wsdl>
> 						<wsdl>${basedir}/src/main/resources/wsdl/ServiceTWO.wsdl</wsdl>
> 						<extraargs>
> 							<extraarg>-frontend</extraarg>
> 							<extraarg>jaxws21</extraarg>
> 							<extraarg>-xjc-Xts</extraarg>
> 							<extraarg>-xjc-Xdv</extraarg>
> 						</extraargs>
> 					</wsdlOption>
> 				</wsdlOptions>
> 			</configuration>
> 			<goals>
> 				<goal>wsdl2java</goal>
> 			</goals>
> 		</execution>
> 	</executions>
> 	<dependencies>
> 		<dependency>
> 			<groupId>org.apache.cxf.xjcplugins</groupId>
> 			<artifactId>cxf-xjc-ts</artifactId>
> 			<version>2.5.2</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf.xjcplugins</groupId>
> 			<artifactId>cxf-xjc-dv</artifactId>
> 			<version>2.5.2</version>
> 		</dependency>
> 	</dependencies>
> </plugin>
> --> WSDL "ServiceONE" generates, in its correspondent XXXX_Service.java, the following
method calls, JAXWS21 compliant:
>     public XXXX_Service(URL wsdlLocation) {
>         super(wsdlLocation, SERVICE);
>     }
>     public XXXX_Service(URL wsdlLocation, QName serviceName) {
>         super(wsdlLocation, serviceName);
>     }
>     public XXXX_Service() {
>         super(WSDL_LOCATION, SERVICE);
>     }
> .........BUT........
> --> WSDL "ServiceTWO" generates, in its correspondent XXXX_Service.java, the following
method calls, NON-JAXWS21 compliant:
>     //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
>     //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
>     //compliant code instead.
>     public XXXX_Service(WebServiceFeature ... features) {
>         super(WSDL_LOCATION, SERVICE, features);
>     }
>     //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
>     //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
>     //compliant code instead.
>     public XXXX_Service(URL wsdlLocation, WebServiceFeature ... features) {
>         super(wsdlLocation, SERVICE, features);
>     }
>     //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
>     //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
>     //compliant code instead.
>     public XXXX_Service(URL wsdlLocation, QName serviceName, WebServiceFeature ... features)
{
>         super(wsdlLocation, serviceName, features);
>     }
> If I use only one WSDL file, everything works fine, but when I use two, the second one
doesn't work. I also tried to use to separate executions but had no success.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message