Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Exceptions differ each generation #250

Open
yoadey opened this issue Mar 3, 2022 · 0 comments
Open

Generated Exceptions differ each generation #250

yoadey opened this issue Mar 3, 2022 · 0 comments

Comments

@yoadey
Copy link

yoadey commented Mar 3, 2022

Description:
The Java files which are generated by the AntCodegenTask for Exceptions differ each generation in the serialVersionUID.
This is especially bothering if the gradle cache should be used, wich requires a fixed input. Also, the objects may not be deserialized again if the SerialVersionUID changes each time.

Suggested Labels:

Suggested Assignees:

Affected Product Version:
All

OS, DB, other environment details and versions:

Steps to reproduce:
Create a WSDL with a wsdl:fault element, e.g:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ExampleModule" targetNamespace="http://www.example.org/">
    <wsdl:types>
        <xsd:schema targetNamespace="http://www.example.org/">
            <xsd:element name="getSolutionById">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="in" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="getSolutionByIdResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="out" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="getSolutionByIdFault">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="getSolutionByIdFault"
                                     type="xsd:string">
                        </xsd:element>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>

        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="getSolutionByIdRequest">
        <wsdl:part element="tns:getSolutionById" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="getSolutionByIdResponse">
        <wsdl:part element="tns:getSolutionByIdResponse" name="parameters"/>
    </wsdl:message>

    <wsdl:message name="getSolutionByIdFault">
        <wsdl:part name="parameters" element="tns:getSolutionByIdFault"></wsdl:part>
    </wsdl:message>
    <wsdl:portType name="ExampleModule">
        <wsdl:operation name="getSolutionById">
            <wsdl:input message="tns:getSolutionByIdRequest"/>
            <wsdl:output message="tns:getSolutionByIdResponse"/>

            <wsdl:fault name="fault" message="tns:getSolutionByIdFault"></wsdl:fault>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="ExampleModuleSOAP" type="tns:ExampleModule">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="getSolutionById">
            <soap:operation soapAction="http://www.example.org/ExampleModule/getSolutionById"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="fault">
                <soap:fault use="literal" name="fault" />
            </wsdl:fault>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="ExampleModule">
        <wsdl:port binding="tns:ExampleModuleSOAP" name="ExampleModuleSOAP">
            <soap:address location="http://www.example.org/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

Generate it again, the serialVersionUID changes

More info
I've checked and found the corresponding issue in the file AxisServiceBasedMultiLanguageEmitter.java in line 1055, where the System.currentTimeMillis() is used for the serialVersionUID.
A hash based on the className and the parameters would probably be better.

Related Issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant