<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: How to do a XML to JSON mapping in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/how-to-do-a-xml-to-json-mapping/qaa-p/13896050#M4887853</link>
    <description>{ "openapi": "3.0.0", "info": { "title": "Employee API", "version": "1.0.0" }, "paths": { "/employees": { "get": { "summary": "Get list of employees", "responses": { "200": { "description": "A list of employees", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Employees" } } } } } } } }, "components": { "schemas": { "Employees": { "type": "object", "properties": { "Employee": { "type": "array", "items": { "type": "object", "properties": { "displayName": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "managerName": { "type": "string" }, "managerEmail": { "type": "string", "format": "email" }, "managerSCIMID": { "type": "string", "format": "uuid" }, "mobilePhone": { "type": "string" }, "email": { "type": "string", "format": "email" }, "SAMAccountName": { "type": "string" }, "userPrincipalName": { "type": "string" } } } } } } } } }</description>
    <pubDate>Fri, 11 Oct 2024 06:42:47 GMT</pubDate>
    <dc:creator>MetehanSoylu1</dc:creator>
    <dc:date>2024-10-11T06:42:47Z</dc:date>
    <item>
      <title>How to do a XML to JSON mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-do-a-xml-to-json-mapping/qaq-p/13587477</link>
      <description>&lt;P&gt;I am trying to post the User's bulk data into IAS system. limitations is that IAS system accepts data only in JSON format. I am trying to map the following XML to JSON in CPI message mapping. Following is my source structure.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Employees&amp;gt;
  &amp;lt;Employee&amp;gt;
    &amp;lt;displayName&amp;gt;John Smith&amp;lt;/displayName&amp;gt;
    &amp;lt;firstName&amp;gt;John&amp;lt;/firstName&amp;gt;
    &amp;lt;lastName&amp;gt;Smith&amp;lt;/lastName&amp;gt;
    &amp;lt;managerName&amp;gt;abc def&amp;lt;/managerName&amp;gt;
    &amp;lt;managerEmail&amp;gt;abc@gmail.com&amp;lt;/managerEmail&amp;gt;
    &amp;lt;managerSCIMID&amp;gt;f7acd9a7-03c5-4a94-a432-5ae5e0b3068b&amp;lt;/managerSCIMID&amp;gt;
    &amp;lt;mobilePhone&amp;gt;+91 1234567890&amp;lt;/mobilePhone&amp;gt;
    &amp;lt;email&amp;gt;john.smith@example.com&amp;lt;/email&amp;gt;
    &amp;lt;SAMAccountName&amp;gt;john.smith@example.com&amp;lt;/SAMAccountName&amp;gt;
    &amp;lt;userPrincipalName&amp;gt;johnsmith&amp;lt;/userPrincipalName&amp;gt;
  &amp;lt;/Employee&amp;gt;
  &amp;lt;Employee&amp;gt;
    &amp;lt;displayName&amp;gt;George Adams&amp;lt;/displayName&amp;gt;
    &amp;lt;firstName&amp;gt;George&amp;lt;/firstName&amp;gt;
    &amp;lt;lastName&amp;gt;Adams&amp;lt;/lastName&amp;gt;
    &amp;lt;managerName&amp;gt;pqr uvw&amp;lt;/managerName&amp;gt;
    &amp;lt;managerEmail&amp;gt;pqr@gmail.com&amp;lt;/managerEmail&amp;gt;
    &amp;lt;managerSCIMID&amp;gt;3f5fe8f9-1e4a-4253-ae1e-b096272e7d2b&amp;lt;/managerSCIMID&amp;gt;
    &amp;lt;mobilePhone&amp;gt;+91 2345678901&amp;lt;/mobilePhone&amp;gt;
    &amp;lt;email&amp;gt;georgeadams@example.com&amp;lt;/email&amp;gt;
    &amp;lt;SAMAccountName&amp;gt;georgeadams@example.com&amp;lt;/SAMAccountName&amp;gt;
    &amp;lt;userPrincipalName&amp;gt;georgeadams&amp;lt;/userPrincipalName&amp;gt;
  &amp;lt;/Employee&amp;gt;
  &amp;lt;Employee&amp;gt;
    &amp;lt;displayName&amp;gt;Jessica Grey&amp;lt;/displayName&amp;gt;
    &amp;lt;firstName&amp;gt;Jessica&amp;lt;/firstName&amp;gt;
    &amp;lt;lastName&amp;gt;Grey&amp;lt;/lastName&amp;gt;
    &amp;lt;managerName&amp;gt;pqr uvw&amp;lt;/managerName&amp;gt;
    &amp;lt;managerEmail&amp;gt;pqr@gmail.com&amp;lt;/managerEmail&amp;gt;
    &amp;lt;managerSCIMID&amp;gt;f7acd9a7-03c5-4a94-a432-5ae5e0b3068b&amp;lt;/managerSCIMID&amp;gt;
    &amp;lt;mobilePhone&amp;gt;+91 3456789012&amp;lt;/mobilePhone&amp;gt;
    &amp;lt;email&amp;gt;jessicagrey@example.com&amp;lt;/email&amp;gt;
    &amp;lt;SAMAccountName&amp;gt;jessicagrey@example.com&amp;lt;/SAMAccountName&amp;gt;
    &amp;lt;userPrincipalName&amp;gt;jessicagrey&amp;lt;/userPrincipalName&amp;gt;
  &amp;lt;/Employee&amp;gt;
&amp;lt;/Employees&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;My target structure looks as:&lt;/P&gt;&lt;LI-CODE lang="json"&gt;{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:BulkRequest"
    ],
    "Operations": [
        {
            "method": "POST",
            "bulkId": "4ecf320f-7bfe-4f8b-91dc-f8f52322d713",
            "path": "/Users",
            "data": {
                "schemas": [
                    "urn:ietf:params:scim:schemas:core:2.0:User",
					"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
                ],
                "userName": "johnsmith",
                "name": {
                    "familyName": "Smith",
                    "givenName": "John"
                },
                "displayName": "John Smith",
                "active": true,
                "emails": [
                    {
                        "value": "john.smith@example.com",
                        "primary": true,
                        "type": "home"
                    }
                ],
				"phoneNumbers": [
                    {
                        "value": "333-333-3333",
                        "primary": true,
                        "type": "work"
                    }
                ],
				"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
                    "manager": {
                        "value": "f7acd9a7-03c5-4a94-a432-5ae5e0b3068b"
                    }
                }
            }
        },
        {
            "method": "POST",
            "bulkId": "11020828-2bc8-45c4-876b-e32b6259fafc",
            "path": "/Users",
            "data": {
                "schemas": [
                    "urn:ietf:params:scim:schemas:core:2.0:User",
                    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
                ],
                "userName": "georgeadams",
                "name": {
                    "familyName": "Adams",
                    "givenName": "George"
                },
                "displayName": "George Adams",
                "active": true,
                "emails": [
                    {
                        "value": "georgeadams@example.com",
                        "primary": true,
                        "type": "home"
                    }
                ],
				"phoneNumbers": [
                    {
                        "value": "444-444-4444",
                        "primary": true,
                        "type": "work"
                    }
                ],
                "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
                    "manager": {
                        "value": "f7acd9a7-03c5-4a94-a432-5ae5e0b3068b"
                    }
                }
            }
        },
        {
            "method": "POST",
            "bulkId": "52b3e095-62c2-4baf-8c0f-106a555537ff",
            "path": "/Users",
            "data": {
                "schemas": [
                    "urn:ietf:params:scim:schemas:core:2.0:User",
                    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
                ],
                "userName": "jessicagrey",
                "name": {
                    "familyName": "Grey",
                    "givenName": "Jessica"
                },
                "displayName": "Jessica Grey",
                "active": true,
                "emails": [
                    {
                        "value": "jessicagrey@example.com",
                        "primary": true,
                        "type": "home"
                    }
                ],
				"phoneNumbers": [
                    {
                        "value": "555-555-5555",
                        "primary": true,
                        "type": "work"
                    }
                ],
                "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
                    "manager": {
                        "value": "f7acd9a7-03c5-4a94-a432-5ae5e0b3068b"
                    }
                }
            }
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I've tried the JSON mapping approach on the blog : &lt;A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-swagger-openapi-spec-json-in-message-mapping/ba-p/13475829" target="_self"&gt;blog for JSON mapping&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After uploading JSON file in message mapping from business accelerator hub:&amp;nbsp;&lt;A href="https://api.sap.com/api/IdDS_SCIM/overview" target="_self"&gt;Business Accelerator hub&lt;/A&gt;&amp;nbsp;it is showing no data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="omkarvilas_a_kandekar_0-1706625955827.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/56305iFCA24474CFF3D397/image-size/medium?v=v2&amp;amp;px=400" role="button" title="omkarvilas_a_kandekar_0-1706625955827.png" alt="omkarvilas_a_kandekar_0-1706625955827.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because of the schemas fields I can not perform XML to XML mapping.&lt;/P&gt;&lt;P&gt;What should I do for XML to JSON conversion?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 14:50:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-do-a-xml-to-json-mapping/qaq-p/13587477</guid>
      <dc:creator>omkar-vilas_a_kandekar</dc:creator>
      <dc:date>2024-01-30T14:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a XML to JSON mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-do-a-xml-to-json-mapping/qaa-p/13896049#M4887852</link>
      <description>This is because your json schema is missing some elements, try this one;</description>
      <pubDate>Fri, 11 Oct 2024 06:41:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-do-a-xml-to-json-mapping/qaa-p/13896049#M4887852</guid>
      <dc:creator>MetehanSoylu1</dc:creator>
      <dc:date>2024-10-11T06:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a XML to JSON mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-do-a-xml-to-json-mapping/qaa-p/13896050#M4887853</link>
      <description>{ "openapi": "3.0.0", "info": { "title": "Employee API", "version": "1.0.0" }, "paths": { "/employees": { "get": { "summary": "Get list of employees", "responses": { "200": { "description": "A list of employees", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Employees" } } } } } } } }, "components": { "schemas": { "Employees": { "type": "object", "properties": { "Employee": { "type": "array", "items": { "type": "object", "properties": { "displayName": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "managerName": { "type": "string" }, "managerEmail": { "type": "string", "format": "email" }, "managerSCIMID": { "type": "string", "format": "uuid" }, "mobilePhone": { "type": "string" }, "email": { "type": "string", "format": "email" }, "SAMAccountName": { "type": "string" }, "userPrincipalName": { "type": "string" } } } } } } } } }</description>
      <pubDate>Fri, 11 Oct 2024 06:42:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-do-a-xml-to-json-mapping/qaa-p/13896050#M4887853</guid>
      <dc:creator>MetehanSoylu1</dc:creator>
      <dc:date>2024-10-11T06:42:47Z</dc:date>
    </item>
  </channel>
</rss>

