Create JSON from XML Entity

Create JSON from XML 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/json?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/xml
  • Response
    • Type: application/json

Example :

::::: REQUEST :::::
[POST] http://localhost:8080/WebRestApi/rest/conversion/json?jsonFormat=QNAME
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<retail:productMedia xmlns:core="" xmlns:hta="" xmlns:htd="" xmlns:htt="" xmlns:ns11="" xmlns:ns13="" xmlns:ns3="" xmlns:ns6="" xmlns:ns8="" xmlns:ns9="" xmlns:retail="" xmlns:sref="" xmlns:tools="" xmlns:xsi="">
    <retail:imageKey type="jpg" category="PRODUCT">1_FPCS7PX</retail:imageKey>
::::: RESULT :::::
  "@qname": "retail:productMedia",
  "productMediaId": "FPCS7PX-M1",
  "productId": {
    "@qname": "retail:productKey",
    "id": "FPCS7P34534543X"
  "sortIndex": 1,
  "mediaType": "IMAGE",
  "mediaSubtype": "LARGE",
  "name": "FPCS7PX-M1",
  "mediaKey": {
    "imageKey": {
      "category": "PRODUCT",
      "id": "1_FPCS7PX",
      "type": "jpg"

How to determine Fully Qualified Class Name of an Enactor Entity #

The easiest way to find out the fully qualified class name of an Enactor entity is to search for it in the jar files.

For instance:

> jar tf mfc-2.7-SNAPSHOT.jar | grep "/ProductMedia.class"

Or to search in all jar files (e.g. navigate to the enactor-lib folder of an Enactor POS)

> find . -name "*.jar" | xargs -n 1 jar tf | grep "/ProductMedia.class"

The fully qualified class name is then obtained by replacing the slash by dot


Go to Top