[ 
https://issues.apache.org/jira/browse/AXIS2-6074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Lazarski resolved AXIS2-6074.
------------------------------------
    Resolution: Fixed

  Fixed on trunk, shipping in 2.0.1. When an empty XML element is sent for an 
enum field (e.g.,
  <eventType/> or <eventType></eventType>), the generated fromValue() method 
now returns null
  instead of throwing IllegalArgumentException. This restores the Axis2 1.6 
behavior.

  The fix applies to both the bean and helpermode ADB codegen templates. Empty, 
null, and
  whitespace-only values are all handled gracefully.

  Note: if your application previously caught IllegalArgumentException from 
fromValue() to detect
  empty enum values, that code path will no longer be triggered — you'll 
receive null instead. This
   is documented as a behavioral change in the 2.0.1 release notes.



> Issue with empty enum tags
> --------------------------
>
>                 Key: AXIS2-6074
>                 URL: https://issues.apache.org/jira/browse/AXIS2-6074
>             Project: Axis2
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.8.2
>         Environment: Axis2 1.8.2
> Java 17.0.5+8-LTS
>            Reporter: Carlos Baron
>            Priority: Major
>             Fix For: 2.0.1
>
>
> Hi there,
> I just did and upgrade from Axis2 1.6.2 to Axis2 1.8.2.
> And unfortunately it looks like there's a new bug with the empty tags for 
> enums and axis returns the following error:
> {code:java}
> processAxisFault() found a null HTTP status from the MessageContext instance, 
> setting HttpServletResponse status to: axis2.http.response.state{code}
> from this method: 
> [https://github.com/apache/axis-axis2-java-core/blob/a8fd43c2aa8a03739cced810842af12ff3ad293d/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java#L409]
> wsdl definition:
> {code:java}
> <wsdl:message name="getUserEventRequest">
>     <wsdl:part name="userEventQuery" type="types:SomeEventFilter"></wsdl:part>
>   </wsdl:message>{code}
> This is an example of the xsd:
> {code:java}
> <xs:complexType name="SomeEventFilter">
>     <xs:sequence>
>       <xs:element minOccurs="0" maxOccurs="1" name="userName" 
> type="xs:string"/>
>       <xs:element minOccurs="0" maxOccurs="1" name="eventType" 
> type="SomeEvent"/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:simpleType name="SomeEvent">
>     <xs:restriction base="xs:string">
>       <xs:enumeration value="ACTION1"/>
>       <xs:enumeration value="ACTION2"/>
>       <xs:enumeration value="ACTION3"/>
>     </xs:restriction>
>   </xs:simpleType>{code}
> And this is the response:
> {code:java}
> <soapenv:Fault> 
>  <faultcode>soapenv:Server</faultcode> 
>  <faultstring>unknown</faultstring> 
>  <detail/> 
> </soapenv:Fault>{code}
> I know for sure that the same wsdl works on Axis2 1.6.2 because I already 
> tested the same request and works fine.
> If you have any insights on this issue, I'll appreciate!
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to