axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juan Cervera" <Juan.Cerv...@nomadsoft.com>
Subject Are there not nillable field checks at deserialization?
Date Wed, 12 Jul 2006 14:21:16 GMT
Hi all,
 
We are using Axis 1.2.1 as a WebService provider and we have experienced
issues when interfacing with clients that are not implemented with Axis.
 
The problem is that when a field is marked as non nillable in the WSDL
(nillable="false") Axis will always check this when working as a client
and will prevent the message being sent if there are nil values in not
nillable fields. But when Axis acts as a the server, this check is not
performed and will take anything coming through. Our issue is that we
expected Axis to verify that non nillable fields where actually present
and populated, so we did not make our own checks for not nillable
fields. As Axis seems like not actually doing these checks we end up
with Null exceptions if any of these fields is not sent or is nil.
 
Of course this kind of issues only happen when the client does not
follow the WSDL specification properly and these issues are discovered
during integration tests, but failing in our code with a null exception
is a lot harder to debug than if Axis would just return an error telling
that such field is not nillable, which will make our integration tests a
lot easier. I can see advocates for both solutions, having Axis checking
or having the server code doing it (which allows for customised error
responses).
 
The checks I've done for Axis 1.4 and 2.0 indicate that this seems to be
still the case in the latest versions of Axis.  I just wanted to check
if this is the expected behaviour, if there is any parameter in Axis
that can be set to turn on this checks at the deserialization level and
what people are doing to deal with this situation, in case that there is
an easier approach than checking manually that the values are not nil.
 
Thanks,
Juan

Mime
View raw message