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

Daniel Kulp commented on CXF-2446:
----------------------------------


There are two answers:

1) No, there isn't a way to generate List<...> for that return unless JAXB has 
a way to generate that for a top level element type, which I don't think it 
does.  We just call off to xjc to have it generate the schemas and then ask it 
the type for each top level element that we need.   Whatever it returns is what 
we need to use.

2) HOWEVER, if you change your original service from BARE mode to the default 
WRAPPED mode, then the wsdl would be different (and WSI-BP compliant as well, 
it currently isn't) but the resulting wsdl WOULD allow the List<...> thing to 
be generated as the return.   In that case, the generated types for the top 
level parts would be the structs, but you would never use them.  We would use 
them internally and you would just deal with the individual params which 
xjc/Xnew would map to List.

> generate java.util.List collections for XMLElementWrappers
> ----------------------------------------------------------
>
>                 Key: CXF-2446
>                 URL: https://issues.apache.org/jira/browse/CXF-2446
>             Project: CXF
>          Issue Type: New Feature
>          Components: Tooling
>            Reporter: warren crossing
>
> when generating code with the xew plugin you have to turn off 
>    <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
> otherwise the cxf proxy will fail at runtime with a class cast exception.
> could some extension be added to generate XMLElementWrappers with one and 
> only one collection as java.util.List?
> <plugin>
>                 <groupId>org.apache.cxf</groupId>
>                 <artifactId>cxf-codegen-plugin</artifactId>
>                 <version>${cxfVersion}</version>
>                 <executions>
>                     <execution>
>                         <id>cxf-shipment</id>
>                         <phase>generate-sources</phase>
>                         <goals>
>                             <goal>wsdl2java</goal>
>                         </goals>
>                         <configuration>
>                             
> <sourceRoot>${project.build.directory}/generated-sources/main</sourceRoot>
>                             <wsdlOptions>
>                                 <wsdlOption>
>                                     
> <wsdl>${basedir}/src/main/resources/ShipmentService.wsdl</wsdl>
>                                     <bindingFiles>
>                                         
> <bindingFile>${basedir}/src/main/resources/bindings-global.xml</bindingFile>
>                                     </bindingFiles>
>                                     <extraargs>
>                                         <arg>-xjc-Xxew</arg>
>                                     </extraargs>
>                                 </wsdlOption>
>                             </wsdlOptions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <defaultOptions>
>                         <autoNameResolution>true</autoNameResolution>
>                     </defaultOptions>
>                     <verbose>true</verbose>
>                 </configuration>
>                 <dependencies>
>                     <dependency>
>                         <groupId>dk.conspicio</groupId>
>                         <artifactId>xew</artifactId>
>                         <version>1.0.0</version>
>                         <scope>runtime</scope>
>                     </dependency>
>                 </dependencies>
>             </plugin>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to