Oracle OIC XML to JSON

Share

Introduction

In modern enterprise integrations, data rarely flows in a single format. Many legacy enterprise applications still exchange messages in XML, while modern SaaS platforms and REST APIs primarily use JSON. Because of this difference, Oracle Integration Cloud Convert XML to JSON functionality becomes extremely important in real-world integrations.

When implementing integrations using Oracle Integration Cloud (OIC Gen 3), consultants often encounter scenarios where an upstream system sends XML payloads while the downstream REST API requires JSON. Instead of building complex transformations manually, OIC provides powerful tools to convert XML payloads into JSON structures during integration flows.

From a consultant’s perspective, this capability is frequently used in integrations involving:

  • Oracle Fusion Cloud applications

  • Third-party REST services

  • Microservices architecture

  • Mobile or web applications

Understanding how to properly perform XML to JSON conversion in Oracle Integration Cloud is an essential skill for integration developers and architects.

This article explains the concept in detail with real implementation examples, step-by-step configuration, and troubleshooting tips used by experienced Oracle consultants.


What is XML to JSON Conversion in Oracle Integration Cloud?

XML to JSON conversion in Oracle Integration Cloud refers to transforming a structured XML message into a JSON payload format so it can be consumed by REST-based services.

OIC handles this conversion through multiple mechanisms:

MethodDescription
Stage File ActionConverts XML to JSON using schema definitions
Mapper TransformationMaps XML elements to JSON structures
REST AdapterAutomatically converts payload format
Integration FunctionsUses expressions to transform structures

In most enterprise integrations, the conversion occurs during data transformation between two adapters.

Example Scenario

A common real implementation scenario:

Source SystemTarget System
Oracle Fusion ERP (SOAP service)External Expense Management System (REST API)

The ERP system sends the data in XML format, while the REST API requires JSON payloads.

Example XML Payload:

 
<Employee>
<EmployeeId>1001</EmployeeId>
<Name>John Smith</Name>
<Department>Finance</Department>
</Employee>
 

Required JSON Format:

 
{
“EmployeeId”: “1001”,
“Name”: “John Smith”,
“Department”: “Finance”
}
 

The integration must convert XML into JSON before sending the request.


Key Features of XML to JSON Conversion in OIC

Oracle Integration Cloud provides several powerful capabilities for this transformation.

1. Automatic Schema-Based Conversion

If the integration uses XSD schemas, OIC can automatically generate JSON structures.

Benefits include:

  • Accurate structure mapping

  • Reduced manual coding

  • Schema validation


2. Visual Data Mapping

Using the OIC Mapper, developers can visually drag and drop XML elements into JSON fields.

Advantages:

  • No coding required

  • Easy debugging

  • Faster development cycles


3. Support for Complex Structures

OIC supports nested structures including:

  • Arrays

  • Objects

  • Nested elements

Example XML:

 
<Order>
<OrderNumber>1234</OrderNumber>
<Items>
<Item>
<Name>Laptop</Name>
<Price>900</Price>
</Item>
</Items>
</Order>
 

Converted JSON:

 
{
“OrderNumber”:“1234”,
“Items”:[
{
“Name”:“Laptop”,
“Price”:900
}
]
}
 

4. Integration with REST Adapters

The REST Adapter in OIC Gen 3 can automatically generate JSON request payloads if configured properly.

This eliminates the need for manual conversions.


5. Runtime Payload Processing

The integration runtime engine can process large payload transformations dynamically without external middleware.


Real-World Integration Use Cases

Use Case 1: Oracle Fusion HCM to External Payroll System

Many payroll vendors expose REST APIs expecting JSON.

However, Oracle Fusion HCM SOAP services return XML payloads.

Integration Flow:

 
Fusion HCM SOAP → OIC Integration → XML to JSON Conversion → Payroll REST API
 

Typical data transferred:

  • Employee records

  • Payroll elements

  • Salary information


Use Case 2: Legacy ERP Integration with Modern Applications

A manufacturing company may run a legacy ERP system sending XML messages.

Meanwhile, their warehouse management system may use REST microservices using JSON.

Integration Process:

 
Legacy ERP XML → OIC → JSON Conversion → Warehouse API
 

This approach avoids rewriting the legacy system.


Use Case 3: Oracle SCM to Logistics Platform

Logistics providers usually expose modern APIs.

Example integration:

 
Oracle SCM Shipment Confirmation (XML)

Oracle Integration Cloud

Convert XML → JSON

Send to Logistics Provider API
 

This is extremely common in supply chain integrations.


Architecture and Technical Flow

Understanding the architecture helps consultants design integrations effectively.

Typical OIC XML to JSON conversion flow:

 
Source System
|
| XML Payload
|
SOAP Adapter / FTP Adapter
|
Integration Flow
|
Mapper Transformation
|
JSON Payload
|
REST Adapter
|
Target Application
 

Key components involved:

ComponentRole
SOAP AdapterReceives XML payload
Integration FlowProcesses data
MapperConverts structure
REST AdapterSends JSON payload

Prerequisites

Before implementing XML to JSON conversion in OIC, ensure the following setup is available.

1. OIC Gen 3 Environment

You must have access to an Oracle Integration Cloud Gen 3 instance.


2. Required Adapters

Depending on the integration scenario:

AdapterUsage
SOAP AdapterXML source
FTP AdapterFile-based XML
REST AdapterJSON target

3. Schema Definitions

If using structured transformations, obtain:

  • XSD schema for XML

  • JSON sample payload or schema

These schemas help the mapper understand payload structure.


4. Required Access Roles

Ensure users have the necessary roles:

  • Service Developer

  • Integration Developer

  • Integration Administrator


Step-by-Step Build Process

Now let’s walk through a real consultant-style implementation of converting XML to JSON in Oracle Integration Cloud.


Step 1 – Create a New Integration

Navigate to:

Home → Integrations → Create

Select:

 
App Driven Orchestration
 

Enter the following values:

FieldExample
NameXML_To_JSON_Integration
Identifierxml_to_json_int
PackageDataTransformation

Click Create.


Step 2 – Configure Source SOAP Adapter

Drag SOAP Adapter into the integration canvas.

Configure the trigger connection.

Provide:

  • WSDL URL or file

  • Operation name

Example Operation:

 
GetEmployeeDetails
 

This SOAP service will return XML payload.


Step 3 – Add REST Adapter for Target

Drag REST Adapter as the invoke connection.

Configure:

ParameterExample
Endpoint URL/employees
MethodPOST
Payload FormatJSON

Upload sample JSON structure if available.


Step 4 – Open Mapper for Transformation

Click Map between SOAP response and REST request.

OIC will display:

Left side → XML structure
Right side → JSON structure

Example mapping:

XML ElementJSON Field
EmployeeIdid
Namename
Departmentdepartment

Drag the XML fields into the JSON structure.


Step 5 – Handle Arrays and Nested Objects

For nested XML elements, create JSON arrays.

Example XML:

 
Orders → Order → Items → Item
 

Mapping must preserve hierarchy.

OIC automatically supports:

  • For-each loops

  • Repeating elements

  • Nested structures


Step 6 – Save and Activate Integration

Click:

 
Save → Activate
 

After activation, the integration endpoint becomes available.


Testing the Technical Component

Testing should always be performed before production deployment.

Test Payload (XML)

Example request:

 
<Employee>
<EmployeeId>1001</EmployeeId>
<Name>John Smith</Name>
<Department>Finance</Department>
</Employee>
 

Expected JSON Output

 
{
“id”:“1001”,
“name”:“John Smith”,
“department”:“Finance”
}
 

Validation Checks

During testing verify:

  • JSON structure matches API specification

  • Data types are correct

  • Required fields are populated

  • No transformation errors occur

Use the OIC Tracking Page for debugging.

Navigate:

 
Home → Integrations → Tracking
 

Search by:

  • Integration name

  • Instance ID


Common Errors and Troubleshooting

Even experienced developers face challenges during XML to JSON transformations.

1. Namespace Issues

XML namespaces can cause mapping failures.

Example:

 
ns1:Employee
 

Solution:

Remove unnecessary namespaces or adjust mappings.


2. Array Handling Problems

Repeated XML elements must map to JSON arrays.

Incorrect mapping causes payload errors.


3. Data Type Mismatch

JSON APIs often require:

  • Integer

  • Boolean

  • Date formats

Ensure correct conversion in mapper.


4. Large Payload Performance

Large XML files can slow transformations.

Solutions:

  • Use streaming processing

  • Break integrations into smaller components


5. Invalid JSON Structure

Missing brackets or improper arrays can cause API failures.

Always validate JSON output using tools like:

  • Postman

  • JSON validators


Best Practices for XML to JSON Conversion in OIC

Experienced Oracle integration consultants follow these best practices.

1. Always Use Schema Definitions

Schemas ensure:

  • Accurate mapping

  • Data validation

  • Easier maintenance


2. Keep Transformations Simple

Avoid complex logic inside a single mapper.

Instead:

  • Break integrations into smaller steps.


3. Validate Payloads Early

Before sending JSON to external systems:

  • Validate structure

  • Validate required fields


4. Implement Error Handling

Use:

  • Global fault handlers

  • Scope fault handlers

Log transformation failures clearly.


5. Monitor Integration Instances

Regularly review:

 
Integration Insights
Tracking Dashboard
 

This helps detect transformation issues quickly.


Frequently Asked Questions

1. Can Oracle Integration Cloud automatically convert XML to JSON?

Yes. OIC can convert XML to JSON automatically when the target adapter expects JSON format and the integration mapper is configured properly.


2. Is coding required for XML to JSON conversion in OIC?

No. Most transformations can be implemented using the visual mapper without writing code.


3. How do you handle nested XML elements during conversion?

Nested XML elements are mapped to JSON objects or arrays using repeating element mappings in the OIC mapper.


Summary

The ability to convert XML to JSON in Oracle Integration Cloud is one of the most frequently used data transformation techniques in enterprise integrations.

Because enterprise systems still rely heavily on XML while modern applications use JSON, integration developers must be comfortable designing reliable transformations between these formats.

Using the capabilities available in Oracle Integration Cloud Gen 3, developers can easily perform these transformations using:

  • Schema-based mapping

  • Visual data mapper

  • REST adapter configurations

  • Structured payload transformations

In real-world implementations, this functionality plays a crucial role in connecting Oracle Fusion applications, third-party SaaS systems, legacy platforms, and modern microservices architectures.

Consultants who master XML to JSON transformation techniques in OIC significantly improve their ability to build scalable and reliable cloud integrations.

For deeper technical reference and integration documentation, consult the official Oracle documentation:

https://docs.oracle.com/en/cloud/saas/index.html


Share

Leave a Reply

Your email address will not be published. Required fields are marked *