Hi all,
while testing a web service with different variations (regarding "nillable" and
"minOccurs")
of input and output parameters, I discovered a few cases where the SOAP
response or the Java
input object passed by Axis appears to be wrong (or at least questionable). For
the complete table,
see below (fixed-width font works best).
Here is the textual description for the first line in the "INPUT" table:
I have a web service that has a string input parameter, either directly in the
service method signature,
or indirectly in a container type. The input parameter is defined in the WSDL
with nillable="false",
but the user sends in nil anyway (so the user is the cause for whatever happens
next). I would
expect that Axis hands over null to the application code, but I get the empty
string instead.
Any comments on this?
Thanks in advance,
Nenad Jovanovic
Cause:
U - Web Service User (Client)
D - Web Service Developer
Categories:
E: Axis error
I: Inconsistency or questionable definition
when a string element in a response object is declared with nillable="true" and
minOccurs="1"
INPUT
=======
cause | cat. | type | iface / cont. | minOccurs | nillable | SOAP
| Java expected | Java actual
------------------------------------------------------------------------------------------------------------------
U | E | String | both | 0/1 | false | xsi:nil="true"
| null | empty string
U | E | String[] | both | 0/1 | false | xsi:nil="true"
| { null } | {empty string}
U | E | Boolean | both | 0 | false | xsi:nil="true"
| null | false
- | I | Boolean | both | 0/1 | true | <..></..>
| null | false
U | I | Boolean | both | 0 | false | <..></..>
| null | false
- | I | Boolean | both | 0/1 | true | <../>
| null | false
| I | Boolean | both | 0 | false | <../>
| null | false
U | I | Boolean | iface | 1 | false | missing
| false (prim.) | NullPointerExc
U | E | Boolean[]| both | 0 | false | xsi:nil=true
| null | false
OUTPUT
=======
cause | cat. | type | iface / container | minOccurs | nillable | Java |
SOAP expected | SOAP actual
-----------------------------------------------------------------------------------------------------------------
D | I | String | container | 1 | true | n.init. |
xsi:nil="1" | missing
- | E | String[] | both | 0/1 | true | null |
missing | xsi:nil="1"
D | E | String[] | both | 0/1 | false | { null } |
xsi:nil="1" | missing
- | E | Boolean[]| both | 0/1 | true | null |
missing | xsi:nil="1"
- | E | Boolean[]| both | 0 | false | { null } |
xsi:nil="1" | missing
- | E | Boolean[]| interface | 1 | false | WSDL2Java
produces illegal code