A Nillable Element Is Not Correctly Marshaled When Returned From A Spring Context
(Doc ID 1448789.1)
Last updated on NOVEMBER 18, 2019
Applies to:
Oracle SOA Suite - Version 11.1.1.4.0 to 11.1.1.5.0 [Release 11gR1]Information in this document applies to any platform.
Symptoms
- In a SOA composite application, a Spring context is used which has a response element that contains a required nillable element
- The issue is that this element is not marshaled with xsi:nil="true" but the element is not in the response at all. As a result, the response is invalid
You obtain something like this:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<env:Body>
<testNillableNumberResponse xmlns="http://testnilelement/">
<return xmlns="" xmlns:ns0="http://xml.someDomain.com/rsg/mpl"/
</testNillableNumberResponse>
</env:Body>
</env:Envelope>
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<env:Body>
<testNillableNumberResponse xmlns="http://testnilelement/">
<return xmlns="" xmlns:ns0="http://xml.someDomain.com/rsg/mpl"/
</testNillableNumberResponse>
</env:Body>
</env:Envelope>
which is invalid because a number element is missing within the return element. You would have expected the following response:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<env:Body>
<testNillableNumberResponse xmlns="http://testnilelement/">
<return xmlns="" xmlns:ns0="http://xml.someDomain.com/rsg/mpl">
<ns0:number xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</return>
</testNillableNumberResponse>
</env:Body>
</env:Envelope>
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<env:Body>
<testNillableNumberResponse xmlns="http://testnilelement/">
<return xmlns="" xmlns:ns0="http://xml.someDomain.com/rsg/mpl">
<ns0:number xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</return>
</testNillableNumberResponse>
</env:Body>
</env:Envelope>
A workaround is to use an element with an optional child element, but this increases the verbosity of the xml.
Changes
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |