You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ceri Hughes (JIRA)" <ji...@apache.org> on 2011/07/18 16:28:00 UTC

[jira] [Created] (CXF-3664) wadl2java : xsd data types aren't mapped to java data types properly if they use mixed case.

wadl2java : xsd data types aren't mapped to java data types properly if they use mixed case.
--------------------------------------------------------------------------------------------

                 Key: CXF-3664
                 URL: https://issues.apache.org/jira/browse/CXF-3664
             Project: CXF
          Issue Type: Bug
          Components: Tooling
    Affects Versions: 2.4.1
         Environment: Windows 7 32 bit
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
            Reporter: Ceri Hughes


The data types in my xsd use mixed case names - e.g. "userDefaults"

When I reference these in my reponse's representation elements, the wadl2java tool is unable to match them to the types processed by the xsd parser.

E.g.

<response status="200">
    <representation mediaType="application/xml" element="fmc:userDefaults" />
</response>

There is a line of code in the org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.matchClassName method that checks the lower-cased version of the generated class name matches the local name of the type from the xsd. This will only ever work ig the local name is completely lowercased OR the method changes to match the 2 strings lower cased.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-3664) wadl2java : xsd data types aren't mapped to java data types properly if they use mixed case.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068023#comment-13068023 ] 

Sergey Beryozkin commented on CXF-3664:
---------------------------------------

Hi, can you provide more info please ? 
I updated the schema in this file:
http://svn.apache.org/repos/asf/cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml

by changing "<xs:element name="thebook2" type="tns:book2"/>"
to
<xs:element name="theBook2" type="tns:book2"/>

and then updated element="prefix:thebook2" to "prefix:theBook2"

and it worked OK.

Can you post a sample schema fragment and provide more details please ?


> wadl2java : xsd data types aren't mapped to java data types properly if they use mixed case.
> --------------------------------------------------------------------------------------------
>
>                 Key: CXF-3664
>                 URL: https://issues.apache.org/jira/browse/CXF-3664
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.4.1
>         Environment: Windows 7 32 bit
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
> Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
>            Reporter: Ceri Hughes
>
> The data types in my xsd use mixed case names - e.g. "userDefaults"
> When I reference these in my reponse's representation elements, the wadl2java tool is unable to match them to the types processed by the xsd parser.
> E.g.
> <response status="200">
>     <representation mediaType="application/xml" element="fmc:userDefaults" />
> </response>
> There is a line of code in the org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.matchClassName method that checks the lower-cased version of the generated class name matches the local name of the type from the xsd. This will only ever work ig the local name is completely lowercased OR the method changes to match the 2 strings lower cased.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-3664) wadl2java : xsd data types aren't mapped to java data types properly if they use mixed case.

Posted by "Ceri Hughes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ceri Hughes updated CXF-3664:
-----------------------------

    Attachment: example.zip

Run wadl2java on the attached application.wadl (which references model.xsd).

The data type is called myData at the moment, and this generates 3 methods with the following signatures:

{code}
    Response exportData();
    void createData();
    void deleteAll();
{code}

If I rename the data type to be mydata (all 3 cases in the model xsd and 2 cases in wadl), I correctly get the following signatures:

{code}
    Mydata exportData();
    void createData(Mydata mydata);
    void deleteAll();
{code}


> wadl2java : xsd data types aren't mapped to java data types properly if they use mixed case.
> --------------------------------------------------------------------------------------------
>
>                 Key: CXF-3664
>                 URL: https://issues.apache.org/jira/browse/CXF-3664
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.4.1
>         Environment: Windows 7 32 bit
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
> Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
>            Reporter: Ceri Hughes
>         Attachments: example.zip
>
>
> The data types in my xsd use mixed case names - e.g. "userDefaults"
> When I reference these in my reponse's representation elements, the wadl2java tool is unable to match them to the types processed by the xsd parser.
> E.g.
> <response status="200">
>     <representation mediaType="application/xml" element="fmc:userDefaults" />
> </response>
> There is a line of code in the org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.matchClassName method that checks the lower-cased version of the generated class name matches the local name of the type from the xsd. This will only ever work ig the local name is completely lowercased OR the method changes to match the 2 strings lower cased.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CXF-3664) wadl2java : xsd data types aren't mapped to java data types properly if they use mixed case.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-3664.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5
                   2.4.2
         Assignee: Sergey Beryozkin

thanks for this example - I missed yesterday that it were the type names which were used with non-anonymous complex types.

Thus JAXBElementProvider with marshalAsJAxbElement property needs to be configured in such cases - however I think we may just need to add an option like -config (where Spring/etc config would be generated with providers added) or update the main code - to be generated as well 

> wadl2java : xsd data types aren't mapped to java data types properly if they use mixed case.
> --------------------------------------------------------------------------------------------
>
>                 Key: CXF-3664
>                 URL: https://issues.apache.org/jira/browse/CXF-3664
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.4.1
>         Environment: Windows 7 32 bit
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
> Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
>            Reporter: Ceri Hughes
>            Assignee: Sergey Beryozkin
>             Fix For: 2.4.2, 2.5
>
>         Attachments: example.zip
>
>
> The data types in my xsd use mixed case names - e.g. "userDefaults"
> When I reference these in my reponse's representation elements, the wadl2java tool is unable to match them to the types processed by the xsd parser.
> E.g.
> <response status="200">
>     <representation mediaType="application/xml" element="fmc:userDefaults" />
> </response>
> There is a line of code in the org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.matchClassName method that checks the lower-cased version of the generated class name matches the local name of the type from the xsd. This will only ever work ig the local name is completely lowercased OR the method changes to match the 2 strings lower cased.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira