Weblogic 10.3 Jax-Rpc Webservice Returned XMLBean with invalid Null Element xsi:nil="true"

(Doc ID 1388686.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle Weblogic Server - Version 10.3 and later
Information in this document applies to any platform.

Symptoms

An XSD element definition was as follows:

<complexType name="OrderInfoType">
<sequence>
<element minOccurs="0" name="A" type="string"/>
<element minOccurs="0" name="Source" type="string"/>
<element minOccurs="0" name="Primary" type="string"/>
<element minOccurs="0" name="Secondary" type="string"/>
<element minOccurs="0" name="B" type="string"/>
.
.
.

Notice <element name="Primary" type="string" minOccurs="0"/>. By default, the value for the optional "nillable" attribute on xsd:element is "false" according to the XML Schema specification.

"3.3.2 XML Representation of Element Declaration Schema Components"
{nillable} The actual value of the nillable [attribute], if present, otherwise false.

"Element Declaration Validation Rules"

3.1 If {nillable} is false, then there must be no attribute information item among the element information item's [attributes] whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is nil.

A Schema for Schemas (normative)
<xs:attribute name="nillable" type="xs:boolean" default="false"
use="optional"/>

But the soap response message returned by WebLogic 10.3 JAX-RPC web service contained "xsi:nil=true" (see the example below). WebLogic should not have returned a response with xsi:nil=true.  The web service client expected the web service to return a OrderInfoType with missing "Primary", "Secondary", and "B" elements.  

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
.
.
.
<v1:OrderInfo>
<v1:A>ABC123</v1:A>
<v1:Source>DEF</v1:Source>
<v1:Primary xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<v1:Secondary xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<v1:B xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
.
.
.
</env:Body>
</env:Envelope>

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms