cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Schroedl (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-1104) WSDLToJava Error -- two elements with the same name defined
Date Sat, 13 Oct 2007 20:26:50 GMT

    [ https://issues.apache.org/jira/browse/CXF-1104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534567
] 

Tom Schroedl commented on CXF-1104:
-----------------------------------


It indeed appears that JAXB cannot bind interfaces out of the box. The JAXB guide linked to
off the CXF website provides some ways to handle interfaces via annotations.

https://jaxb.dev.java.net/guide/Mapping_interfaces.html

Haven't tried their suggestions yet, but I will. If anyone already has a working example of
this, would be a nice addition to the samples or website.




> WSDLToJava Error -- two elements with the same name defined
> -----------------------------------------------------------
>
>                 Key: CXF-1104
>                 URL: https://issues.apache.org/jira/browse/CXF-1104
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.0.2
>         Environment: Java 5.
>            Reporter: Tom Schroedl
>
> The WSDL generated by my JAX-WS service cannot be used to create the client. I get the
following error:
> org.apache.cxf.tools.common.ToolException: WSDLToJava Error : Thrown by JAXB : 'findSystemInfoResponse'
is already defined
> I am trying to return a DTO from a service. The service method's return type is an interface
that the DTO implements. However, while the generated client did create my exception classes,
it didn't create any response classes that I was expecting. In looking at the WSDL, I noticed
the response type wasn't showing up anywhere as a <xs:complexType> under <wsdl:definitions>.
 So, I added @WebMethod and @ResponseWrapper(className="my.package.SysInfoDTO") to the SEI.
Where SysInfoDTO is the concrete class for the return type.
> Doing this did get the concrete class to show up as a complexType. However, now, when
I attempt to generate the client, it fails because there are actually two elements with the
same name:
> <xs:complexType name="sysInfoDTO">
>    <xs:sequence>
>       <xs:element minOccurs="0" name="applicationVersion" type="xs:string"/>
>       <xs:element minOccurs="0" name="currentDatabase" type="xs:string"/>
>       <xs:element minOccurs="0" name="currentSchema" type="xs:string"/>
>    </xs:sequence>
> </xs:complexType>
> <xs:element name="findSystemInfoResponse" nillable="true" type="sysInfoDTO"/>
> ...
> <xs:element name="findSystemInfoResponse" type="findSystemInfoResponse"/>
> <xs:complexType name="findSystemInfoResponse">
>    <xs:sequence>
>       <xs:element minOccurs="0" name="result"/>
>    </xs:sequence>
> </xs:complexType>
> I can see why this would fail as it can't figure out which findSystemInfoResponse element
to use.  Is there something I've missed, should this happen?

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