You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Marc Logemann (JIRA)" <ji...@apache.org> on 2008/09/06 02:14:44 UTC

[jira] Issue Comment Edited: (CXF-1340) wsdl2java overwrites objectFactory methods if multiple service classes are in the same package, causes value type inheritance problems

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

logemann edited comment on CXF-1340 at 9/5/08 5:14 PM:
------------------------------------------------------------

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.

I just checked the bug description again, perhaps i have something diferent. I have a schema def like this:

<xsd:schema targetNamespace="http://domain.netversys.de" ....>
a "User" complex Type....
</xsd:schema>

in one WSDL and this in another:

<xsd:schema targetNamespace="http://domain.netversys.de" ....>
a "House" complex Type....
</xsd:schema>

Only the last processed WSDL via WSDLToJava will make it into the ObjectFactory, the other gets overwritten. In fact, a "User" cant be created by the framework then.


      was (Author: logemann):
    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.