Quite simple: xsi:null is not a valid attribute. Per spec, xsi:nil="true" is the attribute used to signal that an element's content is "nil" or "null". See: http://www.w3.org/TR/xmlschema11-1/#xsi_nil
There isn't an attribute defined for xsi:null. I have a feeling if schema validation was turned on, that would generate an error. Dan On Sat January 2 2010 7:48:55 pm rezka wrote: > Hi I'm using CXF 2.2.5 to generate some simple webservices. > One of my webservice methods takes this object as parameter: > <xs:complexType name="absenceRegistrationForm"> > <xs:sequence> > <xs:element minOccurs="0" name="absence_reason" nillable="true" > type="xs:string"/> > <xs:element minOccurs="0" name="absent" type="xs:boolean"/> > <xs:element name="courseParticipantId" type="xs:int"/> > </xs:sequence> > </xs:complexType> > > The request is: > > <v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" > xmlns:d="http://www.w3.org/2001/XMLSchema" > xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"> > <v:Header /> > <v:Body> > <n0:registerAbsence id="o0" c:root="1" > xmlns:n0="http://absence.foo2.foo.com/"> > <AbsenceRegistrationForms i:type="d:anyType"> > <courseParticipantId > i:type="d:int">1</courseParticipantId> > <absent i:null="true" /> > <absence_reason i:null="true" /> > </AbsenceRegistrationForms> > </n0:registerAbsence> > </v:Body> > </v:Envelope> > > Now, I set both absent and absence_reason to null. > for absent (boolean) i get null as I expected, but for absence_reason > (String) I get an emphty string! > > If I change <absence_reason i:null="true" /> to <absence_reason > i:nil="true" /> it works fine. > > why???? > -- Daniel Kulp [email protected] http://www.dankulp.com/blog
