On Wed, Sep 16, 2009 at 7:14 PM, Mauro Molinari <mauro.molin...@cardinis.com > wrote:
> Pär Malmqvist ha scritto: > >> When my adb Axis2 service should return an array with no elements to my >> client it looks like the client >> receives null instead of an array with zero elements. >> > > I also noticed that an Axis2 client "decodes" an "empty" array as null and > I don't know of any way to configure this. If you are working with other > clients (.NET ones?), maybe the convention adopted is the same. > > I think that the main reason of the ambiguity between "empty array" and > "null array" in web services is that it is not clear how to distinguish the > two cases given a SOAP message (that carries such an array) structured > following the XML Schema definition of a document/literal WSDL. > yes this is the reason. The only solution is to check both conditions at the client side when writing the business logic. eg. if ((array == null) or (array[0] == null) ) thanks, Amila. > > -- > Mauro Molinari > Software Designer & Developer > E-mail: mauro.molin...@cardinis.com > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/