Conversion API

Internal Jira reference:  PLAT-10136 – REST Endpoint to convert XML to JSON READY FOR TEST

The conversion API is used to convert Enactor entities across xml and JSON formats.

Create XML from JSON Entity #

Creates an XML Enactor entity by converting a JSON Enactor entity. The JSON is deserialized using the class name(FQCN) and the relevant JSON Format. The JSON Format is specified by the optional query parameter jsonFormat (this Defaults to Enactor).

Service Definition:

  • Method – Url – [ POST ] :   /conversion/xml/{CLASS_NAME}?jsonFormat={JSON_FORMAT}
  • Query Parameter
    • {JSON_FORMAT} – The format of the JSON payload – [ENACTOR, TYPED, SIMPLE, QNAME, CLASS]
  • Path variable : 
    • {CLASS_NAME} – Fully qualified class name of the Enactor Entity
  • Body – JSON String 
  • Request Header
    • Content-type : application/json
  • Response
    • Type: application/xml

Example :

::::: REQUEST :::::
[POST] http://localhost:8080/WebRestApi/rest/conversion/xml/com.enactor.mfc.productMedia.ProductMedia?jsonFormat=SIMPLE
  "@qname": "retail:productMedia",
  "productMediaId": "FPCS7PX-M1",
  "productId": {
    "@qname": "retail:productKey",
    "id": "FPCS7PX"
  "sortIndex": 1,
  "mediaType": "IMAGE",
  "mediaSubtype": "LARGE",
  "name": "FPCS7PX-M1",
  "mediaKey": {
    "imageKey": {
      "category": "PRODUCT",
      "id": "1_FPCS7PX",
      "type": "jpg"
::::: RESULT :::::
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:productMedia xmlns:ns2="" xmlns:ns3="" xmlns:ns4="" xmlns:ns5="" xmlns:ns6="" xmlns:ns7="" xmlns:ns8="" xmlns:ns9="" xmlns:ns10="" xmlns:ns11="" xmlns:ns12="" xmlns:ns13="" xmlns:ns14="" xmlns:ns15="">
<ns2:imageKey type="jpg" category="PRODUCT">1_FPCS7PX</ns2:imageKey>

Go to Top