axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Antonio (JIRA)" <>
Subject [jira] Commented: (AXIS2-3028) Generated ADBBean: Issue with getPullParser() method for optional attributes
Date Fri, 07 Sep 2007 16:38:31 GMT


Jose Antonio commented on AXIS2-3028:

Well, that would work if it weren't because of this bug:

Anyway, using OMElement as an intermediary object does not solve the problem. getPullParser()
method still does not respect the optional attributes so I suggest to reopen this bug if you
wish and if that method is not going to be deprecated for the 1.4 version.

> Generated ADBBean: Issue with getPullParser() method for optional attributes
> ----------------------------------------------------------------------------
>                 Key: AXIS2-3028
>                 URL:
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.2
>            Reporter: Tobias Jordan
>            Assignee: Amila Chinthaka Suriarachchi
> A complexType in my XSD file contains a optional attribute. For example:
> <xs:complexType name="foo_T">
>      <xs:attribute use="optional" name="bla" type="bla_T">
> </xs:complexType>
> The generated ADBBean class has the following code part in the getPullParser()
> attribList.add(new javax.xml.namespace.QName("", "bla"));
> attribList.add(localBla.toString());
> And here comes the issue:
> I wrote a custom handler to print the SOAP messages to stdout:
> SOAPEnvelope env = msgContext.getEnvelope();
> System.out.println(env.toString());
> For messages containing an optional attribute as described above, the toString() call
on the SOAP envelope results in a NullPointerException. The NullPointer occurs because toString()
ends up in the getPullParser() method and the localBla variable isn't set (since it is optional!).
> So I guess there is a missing check against null in the generated code. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message