Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

soa/osb convert json {"@nil": "true"} to null

2905067Dec 14 2016 — edited Dec 20 2016

Hi,

I have built a webservice in SOA 12.1.3 from database, the response from the service can be XML or JSON. Some elements in the response could be null, so the XML response of the empty elements contains xsi:nil="true". When the response is in JSON, the empty elemets are {@nil:true}.      I would like to convert the nil value in json to null like "NEXTDATE": {"@nil": "true"} to "NEXTDATE": null.

I am not familiar with Java, so any help with XQUERY or XSLT would be helpful.

sample XML response

<X_LINES_ITEM>

<ITEMCODE>0001-1000</ITEMCODE>

<ITEMDESCRIPTION>ItemDesc</ITEMDESCRIPTION>

<AVAILABLE>0</AVAILABLE>

<NEXTDATE xsi:nil="true"/>

<IMAGE xsi:nil="true"/>

</X_LINES_ITEM>

sample JSON response

X_LINES_ITEM": [

      {

        "ITEMCODE": "0001-1000",

        "ITEMDESCRIPTION": "ItemDesc",

        "AVAILABLE": 0,

        "NEXTDATE": {

          "@nil": "true"

        },

        "IMAGE": {

          "@nil": "true"

        },

      },

Thanks,

Sri

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2017
Added on Dec 14 2016
1 comment
1,336 views