You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Stefan Odendahl (Created) (JIRA)" <ji...@apache.org> on 2011/12/05 13:05:40 UTC

[jira] [Created] (CXF-3953) wadl2java doesn't find types with underscore in their name

wadl2java doesn't find types with underscore in their name
----------------------------------------------------------

                 Key: CXF-3953
                 URL: https://issues.apache.org/jira/browse/CXF-3953
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.5
            Reporter: Stefan Odendahl


wadl2java has problems when type names in XSD have underscores in them. The generated Java interface will be wrong.

Example from the CXF SVN:
The generated Java interface BooStore.java for systests/jaxrs/src/test/resources/wadl/bookstoreImport.xsd
contains this line:
    public void addBook(@PathParam("bookid") int bookid, Book book) {

In systests/jaxrs/src/test/resources/wadl/schemas/book.xsd, change the type name "book" to "bo_ok". After this change, the generated interface looks like this:
    public void addBook(@PathParam("bookid") int bookid) {

If the underscore was used in a type that is used for parameters, then the parameter will be missing in the interface.
If the type is used as a response, then it will be replaced by the generic class "Response".

The problem is most likely that the class name for the type bo_ok is "BoOk" (as expected if you're familiar with JAXB), but wadl2java does not expect this kind of renaming.


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

        

[jira] [Resolved] (CXF-3953) wadl2java doesn't find types with underscore in their name

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

Sergey Beryozkin resolved CXF-3953.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5.1
                   2.4.5
         Assignee: Sergey Beryozkin

thanks for the analysis, made it easy for me to figure out where the problem was
                
> wadl2java doesn't find types with underscore in their name
> ----------------------------------------------------------
>
>                 Key: CXF-3953
>                 URL: https://issues.apache.org/jira/browse/CXF-3953
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5
>            Reporter: Stefan Odendahl
>            Assignee: Sergey Beryozkin
>             Fix For: 2.4.5, 2.5.1
>
>
> wadl2java has problems when type names in XSD have underscores in them. The generated Java interface will be wrong.
> Example from the CXF SVN:
> The generated Java interface BooStore.java for systests/jaxrs/src/test/resources/wadl/bookstoreImport.xsd
> contains this line:
>     public void addBook(@PathParam("bookid") int bookid, Book book) {
> In systests/jaxrs/src/test/resources/wadl/schemas/book.xsd, change the type name "book" to "bo_ok". After this change, the generated interface looks like this:
>     public void addBook(@PathParam("bookid") int bookid) {
> If the underscore was used in a type that is used for parameters, then the parameter will be missing in the interface.
> If the type is used as a response, then it will be replaced by the generic class "Response".
> The problem is most likely that the class name for the type bo_ok is "BoOk" (as expected if you're familiar with JAXB), but wadl2java does not expect this kind of renaming.

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