Hello fellow developers(?)

I'm running Apache SOAP 2.2 (not the nightly builds) and I'm having problem
with the xsi:null attribute. I've found that xsi:null only works with the
99-xsi namespace. The problem is in the static method
SoapEncUtils.isNull(Element element). Below is a quick fix I made to make
this work with all namespaces for xsi. I have also included a new constant
to make this method work with the Microsoft .Net Beta 2 who send xsi:null's
as xsi:null="1". If this is allready fixed in the nightly builds please
excuse this posting.

cheers,
-kims-


org.apache.soap.encoding.soapenc.SoapEncUtils

  public static boolean isNull(Element element)
  {
        String nullValue = DOMUtils.getAttributeNS(element,
        
Constants.NS_URI_1999_SCHEMA_XSI,
        
Constants.ATTR_NULL);
        if( nullValue == null ) {
                nullValue = DOMUtils.getAttributeNS(element,
        
Constants.NS_URI_2000_SCHEMA_XSI,
                                                   Constants.ATTR_NULL);
        }

        if( nullValue == null ) {
                nullValue = DOMUtils.getAttributeNS(element,
        
Constants.NS_URI_2001_SCHEMA_XSI,
                                                   Constants.ATTR_NULL);
        }
        
        return (( nullValue != null ) &&
                        ( nullValue.equals(Constants.ATTRVAL_TRUE) ||
                      nullValue.equals(Constants.ATTRVAL_1)));
  }
org.apache.soap.Constants  
         public static String ATTRVAL_1 = "1";

Reply via email to