You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Juan Cervera <Ju...@nomadsoft.com> on 2006/07/12 16:21:16 UTC

Are there not nillable field checks at deserialization?

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

Re: Are there not nillable field checks at deserialization?

Posted by Anne Thomas Manes <at...@gmail.com>.
Junaid is correct. Axis does not perform an automatic validation of
incoming messages because it is a very expensive process.

You have two choices: use a handler or intermediary to perform
validation, or write a null exception handler in your code.

Anne

On 7/12/06, Bhatra, Junaid <jb...@rsasecurity.com> wrote:
>
>
>
>
> Are you using Axis-generated (WSDL2Java) server side classes? The
> axis-generated classes do some kind of Schema checking (not sure if nillable
> check is done). It does not carry out a complete Schema validation. You can
> always write a handler that does Schema validation and plug it in the
> request flow. Keep in mind that complete Schema validation is very
> performance intensive.
>
>
>
> - Junaid
>
>
>
>  ________________________________
>
>
> From: Juan Cervera [mailto:Juan.Cervera@nomadsoft.com]
>  Sent: Wednesday, July 12, 2006 10:21 AM
>  To: axis-user@ws.apache.org
>  Subject: Are there not nillable field checks at deserialization?
>
>
>
>
>
> 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
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Are there not nillable field checks at deserialization?

Posted by "Bhatra, Junaid" <jb...@rsasecurity.com>.
Are you using Axis-generated (WSDL2Java) server side classes? The
axis-generated classes do some kind of Schema checking (not sure if
nillable check is done). It does not carry out a complete Schema
validation. You can always write a handler that does Schema validation
and plug it in the request flow. Keep in mind that complete Schema
validation is very performance intensive.

 

- Junaid

 

________________________________

From: Juan Cervera [mailto:Juan.Cervera@nomadsoft.com] 
Sent: Wednesday, July 12, 2006 10:21 AM
To: axis-user@ws.apache.org
Subject: Are there not nillable field checks at deserialization?

 

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