Siebel does not provide any out of the box functionality to convert Siebel data into JSON string or vice versa. Developers end up with string manipulations or giving up on integration. I have created custom EAI JSON Converter business service which uses Java capabilities and Siebel-Java integration EAI Java Business Service to produce fully compliant JSON strings and convert the external JSON into Siebel Property Sets.
The service built on the lines of methods of EAI XML Converter which converts Property set to XML Doc and XML Doc to property set.
Methods available in EAI JSON Converter are:
- JSONToPropSet
- PropSetToJSON
Input data to this service is sent to EAIJSONConvert java class using Siebel API(Siebel.jar) which converts the data in required format using GSON 2.2.4 Java API . The Gson library was originally developed for internal purposes of Google, and Version 1.0 was later released on May 22, 2008 under the terms of Apache License 2.0. The latest version, 2.2.4, is used for the service.
How to set up:
1. Download and place java files in the CLASSES folder of Siebel Client the binaries
Download location: GitHub Project(https://github.com/Jimjson/Siebel-EAI-JSON-Converter/) for:
Files:
EAIJsonConverter.class
gson-2.2.4.jar
Siebel.jar
2. Download the sif file for EAI JSON Converter from github
3. Update the cfg file to include gson-2.2.4.jar file. My cfg file look like:
[JAVA]
DLL = C:\Program Files\java\jre6\bin\client\jvm.dll
CLASSPATH = C:\Siebel\8.1\Tools_1\CLASSES\Siebel.jar;C:\Siebel\8.1\Tools_1\CLASSES\SiebelJI_enu.jar;C:\Siebel\8.1\Tools_1\CLASSES\gson-2.2.4.jar;C:\Siebel\8.1\Tools_1\CLASSES\.
VMOPTIONS = -Xrs -Djava.compiler=NONE -Djms.log=C:\logs\
4. Simulate the service
How to use:
Service can simply be used in place of EAI XML converter to convert the Siebel message into JSON or convert back JSON to property set.
Please feel free to use comments for any questions or to post any difficulty faced in using the service.
Hope it helps.
-Jim