cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Bertram (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-7074) wsdl2java generates invalid Java code when fault element is imported
Date Sun, 02 Oct 2016 03:10:20 GMT

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

Niels Bertram commented on CXF-7074:
------------------------------------

Further I noticed that  [JAXBDataBinding.getType()|https://github.com/apache/cxf/blob/master/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java#L843]
will never return a type for a fault element reference that was imported into the wsdl and
is part of an episode compilation (in my example {{u:Fault}}. If the fault was generated by
the same CXF session then its all good.

> wsdl2java generates invalid Java code when fault element is imported
> --------------------------------------------------------------------
>
>                 Key: CXF-7074
>                 URL: https://issues.apache.org/jira/browse/CXF-7074
>             Project: CXF
>          Issue Type: Bug
>          Components: Soap Binding
>    Affects Versions: 3.1.7
>            Reporter: Niels Bertram
>
> CXF wsdl2java tooling generates invalid Java sources when the fault element  in the fault
message is imported from a copmilation eposide.
> I created a wsdl that defines a xml schema with an include from a already packaged XSD/bindings
jar.
> {code:xml}
> <wsdl:types>
>   <xsd:schema targetNamespace="urn:io.fares.model.example.utility" xmlns="urn:io.fares.model.example.utility">
>     <xsd:include schemaLocation="utility/Fault.xsd"/>
>   </xsd:schema>
> </wsdl:types>
> {code}
> it then references an element defined in the referenced schema
> {code:xml}
> <wsdl:message name="GetCustomerException">
>   <wsdl:part name="err" element="u:Fault"/>
> </wsdl:message>
> {code}
> but when it generates code it fails to fully qualify the name of the imported and already
generated XML Bean / Java class.
> {code:java}
> package io.fares.examples.one.services; // <---- generated into the services' package
> import javax.xml.ws.WebFault;
> // <--- I would expect another import of io.fares.model.example.utility.Fault here
> @WebFault(name = "Fault", targetNamespace = "urn:io.fares.model.example.utility")
> public class GetCustomerException extends RuntimeException {
>     public static final long serialVersionUID = 1L;
>     
>     private Fault fault; // <--- Fault should be fully qualified class name but its
not
>     // ...
>     public Fault getFaultInfo() {
>         return this.fault;
>     }
> }
> {code}
> I think the problem is somewhere around {{org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil.getFullClzName}}
but have not been able to figure out exactly why it fails to insert the fully qualified class
name into the generated exception.
> An example showing the failed copmilation can be found on [GitHub|https://github.com/fareliner/design-builder-examples/tree/master/multi-dependency/service-a]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message