Forum Stats

  • 3,757,882 Users
  • 2,251,289 Discussions
  • 7,869,962 Comments

Discussions

Conversion of JSON data to desired result by excluding root node

Hi Team,

While conversion of JSON data to a desired result format [ excluding the root node]. Could you please assist on the feasible solution to conversion

your inputs will be highly appreciated.

Example:

{

   "shipmentRequest": {

      "@xmlns": "",

      "@soap": "http://schemas.xmlsoap.org/wsdl/soap/",

      "@nstrgdfl": "http://xmlns.oracle.com/procmon",

      "@plnk": "http://schemas.xmlsoap.org/ws/2003/05/partner-link/",

      "@wsdl": "http://schemas.xmlsoap.org/wsdl/",

      "Kind": "1",

      "ActorCSID": "63",

      "ProdConceptID": "1032",

      "Addresses": [

         {

            "Kind": "1",

            "Name1": "Test sender",

            "Street1": "Test Address",

            "PostCode": "0580",

            "City": "OSLO",

            "Phone": "23249480",

            "Mobile": "04799999999",

            "Attention": "test",

            "CountryCode": "NO"

         },

         {

            "Kind": "2",

            "Name1": "Test sender2",

            "Street1": "Test Address2",

            "PostCode": "9999",

            "City": "BLR",

            "Phone": "23222222",

            "Mobile": "04799999999",

            "Attention": null,

            "CountryCode": "NO"

         }

      ],

      "Lines": {

         "PkgWeight": "5000",

         "Pkgs": [

            {

               "ItemNo": "1"

            },

            {

               "ItemNo": "2"

            }

         ]

      }

   }

}

Expected result:

---------------------

{

      "Kind": "1",

      "ActorCSID": "63",

      "ProdConceptID": "1032",

      "Addresses": [

         {

            "Kind": "1",

            "Name1": "Test sender",

            "Street1": "Test Address",

            "PostCode": "0580",

            "City": "OSLO",

            "Phone": "23249480",

            "Mobile": "04799999999",

            "Attention": "test",

            "CountryCode": "NO"

         },

         {

            "Kind": "2",

            "Name1": "Test sender2",

            "Street1": "Test Address2",

            "PostCode": "9999",

            "City": "BLR",

            "Phone": "23222222",

            "Mobile": "04799999999",

            "Attention": null,

            "CountryCode": "NO"

         }

      ],

      "Lines": {

         "PkgWeight": "5000",

         "Pkgs": [

            {

               "ItemNo": "1"

            },

            {

               "ItemNo": "2"

            }

         ]

      }

   }

Thanks,

Janardhan