[ 
https://issues.apache.org/jira/browse/TUSCANY-3298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966583#action_12966583
 ] 

Simon Nash commented on TUSCANY-3298:
-------------------------------------

Here are the code changes that I have made to emable JAXB wrapper generation.

1. In Interface2WSDLGenerator, set the flag to use JAXB wrappers.

2. In Input2InputTransformer and Output2OutputTransformer, strip leading 
underscores from element names when doing the wrapper compatibility comparison. 
 This is needed because if all the following are true:
  - the child is a java.util.Map type
  - the child's name is a Java keyword (e.g., return)
  - Tuscany is using a generated JAXB wrapper class for WSDL generation
then the Java to WSDL generation process results in the WSDL element name 
having a leading underscore added to the actual element name.  This is because 
of a known JAXB issue that prevents the Tuscany code generator from using the 
@XmlElement annotation on a java.util.Map type property field in the wrapper 
bean (see https://jaxb.dev.java.net/issues/show_bug.cgi?id=268).  Without this 
annotation, the generated field name is used as the element name.  The 
generated field name would normally be the same as the element name, but if the 
element name is the same as a Java keyword then the field name needs to be 
changed to satisfy valid Java syntax.

3. In JAXBContextHelper, update the code to add types to the JAXB context so 
that this code doesn't add collection types enclosed by the wrappers (which 
causes JAXB errors), but does add type arguments for non-collection 
parameterized types.

4. In SDODataBinding, update the introspection code to detect collections 
(e.g., lists) of dynamic SDOs.

5. In SDOTypeHelper and Interface2WSDLGenerator, detect introspected 
collections and set maxOccurs="unbounded" for these in the generated WSDL.

6. In binding-ws-axis2, comment out the test method in FileTransferService.java 
that causes a WSDL generation error when using JAXB wrappers.  This problem is 
being tracked under TUSCANY-3805.


> Tuscany generated wrappers are not correct in all situations
> ------------------------------------------------------------
>
>                 Key: TUSCANY-3298
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3298
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Axis Binding Extension
>    Affects Versions: Java-SCA-1.5.1
>         Environment: All
>            Reporter: Simon Laws
>            Assignee: Simon Nash
>             Fix For: Java-SCA-1.x
>
>
> While fixing TUSCANY3283 I noticed and interesting effect of generating 
> wrapper schema ourselves rather than letting JAXB do it. From itest/wsdlgen, 
> for the type...
> @XmlType(name="")
> public class CBean { 
> }
> Our wrapper generation code produces 
> <xs:element name="getGreetingsCBean">
>   <xs:complexType>
>     <xs:sequence>
>       <xs:element minOccurs="0" name="arg0" nillable="true" type=""/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:element>
> I assume this is because the wrapper has no type name to play with. This is 
> easily fixed by getting JAXB to generate the wrappers for us, in which case 
> the structure for CBean is generated in line. However the downside of this 
> change is that some tests in the build fail. See this discussion... 
> http://www.mail-archive.com/dev%40tuscany.apache.org/msg10002.html

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