cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Logemann (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-1340) wsdl2java overwrites objectFactory methods if multiple service classes are in the same package, causes value type inheritance problems
Date Sat, 06 Sep 2008 00:10:44 GMT

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

Marc Logemann commented on CXF-1340:
------------------------------------

checked the diffs and cant see how this problem is solved by these few changed lines in 2-3
files. Perhaps its a JAXB limitation, yes, but to me it is quite questionable why i shouldnt
be able to generate the same schema (from different wsdl's) into one package. Thats exactly
how it should work. I tried to create a "meta" wsdl by including all my child wsdls but i
got a NullPointerException in WSDLToJava.

I will check the jaxb folks if i can get someone there....  I am totally not convinced that
this is the way it should work.



> wsdl2java overwrites objectFactory methods if multiple service classes are in the same
package, causes value type inheritance problems
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1340
>                 URL: https://issues.apache.org/jira/browse/CXF-1340
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.0.3, 2.1
>         Environment: Windows XP, eclipse
>            Reporter: Incognito
>            Assignee: Sean O'Callaghan
>         Attachments: cxf-issue-objectFactory.zip
>
>
> If you have two wsdl-based services, who's wsdl2java output is in the same package, the
outputted objectFactory retains only the most recent service's methods. 
> For example:
> Given two wsdl files, CarService.wsdl and UserService.wsdl; if one executes the wsdl2java
binary with both services; with CarService first and UserService second, and with both service
classes being output in package org.example.api, then only one objectFactory.java class will
be created. First, objectFactory will be created with the objects for CarService.wsdl, and
then it will be overwritten with UserService.wsdl's objects. 
> It just so happens that in this scenario, if the former service contains an object that
is abstract, that is, that it contains types that inherit via wsdl's extension keyword, AND
methods for creating instances of CarService.wsdl's outputted java are NOT present in objectFactory.java,
then CXF does not include type information in the SOAP messages. 
> For example: 
> given an alternate CarService.wsdl with the following types:
>   <complexType name="Car" abstract="true">
>     ...
>   </complexType>
>   <complexType name="Jeep">
>     <extension base="Car">
>      ...
>     </extension>
>   </complexType>
> If CarService.wsdl also had a method called getCarById, and wsdl2java output 2 java classes:
getCarById.java and getCarByIdResponse.java, AND wsdl2java on UserService.wsdl was executed
AFTER it was executed on CarService (resulting in an objectFactory without create methods
for getCar*), then CXF will send SOAP messages like the following
> <soap>
>   <getCarByIdResponse> <!-- type information here would mistakenly be missing
--> 
>    ...
>   </getCarByIdResposne>
> </soap>
> The ultimate result is that if a project has more than 1 service being output in the
same package AND if more than 1 type in those two services use type extension, then CXF will
have problems marshalling those classes because it will end up leaving out the type information
for all classes not included in the ObjectFactory. One alternative would be to have the wsdl2java
classes be output to multiple packages. If the different services shared types, this would
result in duplicated code in each service.

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


Mime
View raw message