cxf-issues mailing list archives

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


Niels Bertram commented on CXF-7074:

Essentially the fully qualified classname of the faultInfo field {{fField}} created on line
of the [|]
is not set correctly.

Intersestingly the {{fPackageName}} set on line line [131|]
is compared against itself on line [137|]
so that condition would never execute, the fault message itself would always be in the same
package as the method interface itself (unless someone can tell me how to put a {{wsdl:message}}
definition into a different namespace.

<wsdl:message name="TheCxfWrapperException" > <-- probably always be the same namespace
as the operation
  <wsdl:part name="fault" element="u:Fault" />

The conditional code would still fail to set the correct classname of the faultInfo field
{{fField}} as neither line [138|]
or [141|]
produce a fully qualified classname for the `faultInfo` part even if they would be executed.

So downstream problem proably also in [|]
or [|].

> wsdl2java generates invalid Java code when fault element is imported
> --------------------------------------------------------------------
>                 Key: CXF-7074
>                 URL:
>             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
> {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; // <---- generated into the services' package
> import;
> // <--- 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
>     // ...
>     public Fault getFaultInfo() {
>         return this.fault;
>     }
> }
> {code}
> I think the problem is somewhere around {{}}
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|]

This message was sent by Atlassian JIRA

View raw message