# JSON Support for IS

**URL:** <https://techcommunity.softwareag.com/t/json-support-for-is/100385>\
**Category:** Forum\
**Tags:** mobile\
**Created:** [February 24, 2012, 8:48pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385 "2012-02-24T20:48:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dr\_Peter\_Nevermann](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@Dr\_Peter\_Nevermann](https://techcommunity.softwareag.com/u/Dr_Peter_Nevermann)\
**Post date:** [February 24, 2012, 8:48pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/1 "2012-02-24T20:48:35Z")

</div>

Hi,

might this be helpful for somebody?

Because I needed it, I created a small IS package “JsonSupport” which includes two services:

- documentToJSONString (accepts Document or DocumentList as input)
- jsonStringToDocument (returns Document or DocumentList depending on the input)

The accompanying “JsonSupportTEST” folder contains files to test the services in Designer (Service-Runner → “Load and Replace…”).

Internally, it uses the org.json Java package downloaded from [url=http://www.json.org/java/][http://www.json.org/java/[/url]](http://www.json.org/java/%5B/url%5D).  
On the Mobile Designer side, [org.json.me](http://org.json.me) is a good counterpart ([url=https://github.com/upictec/org.json.me/][https://github.com/upictec/org.json.me/[/url]](https://github.com/upictec/org.json.me/%5B/url%5D) ).

Be aware that this is experimental … good for demos perhaps … but probably is not be the “perfect” implementation. So, expect horrible bugs … poor scaling … and many more bad things 😉

Regards,  
Peter

[JsonSupport.zip](https://techcommunity.softwareag.com/uploads/short-url/ezAzBqzZvNQFoPPiucym64Gy0uy.zip) (52.7 KB)  
[JsonSupportTEST.zip](https://techcommunity.softwareag.com/uploads/short-url/cqW8Wmp8cYoLFPUSq3FDg9cuIu0.zip) (5.2 KB)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [February 24, 2012, 11:48pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/2 "2012-02-24T23:48:20Z")

</div>

There is a project on Labcase that provides full JSON support. Please check with Kevin Bouck.

---

<div class="post-metadata">

**Author:** ![Dr\_Peter\_Nevermann](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@Dr\_Peter\_Nevermann](https://techcommunity.softwareag.com/u/Dr_Peter_Nevermann)\
**Post date:** [February 27, 2012, 5:31pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/3 "2012-02-27T17:31:20Z")

</div>

Thanks Christian!  
I had overseen the existence of xWmJSON in LabCase.

Regards,  
Peter

---

<div class="post-metadata">

**Author:** ![Chandra6](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/chandra6/32/300_2.png) [@Chandra6](https://techcommunity.softwareag.com/u/Chandra6)\
**Post date:** [May 7, 2012, 7:06pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/4 "2012-05-07T19:06:48Z")

</div>

Hi Peter,  
How can I get the xWmJSON from LabCase? Thanks -Chandra

---

<div class="post-metadata">

**Author:** ![Chandra6](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/chandra6/32/300_2.png) [@Chandra6](https://techcommunity.softwareag.com/u/Chandra6)\
**Post date:** [May 15, 2012, 7:46pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/5 "2012-05-15T19:46:05Z")

</div>

Using JSON API I could convert XML to target format. Below is the snippet placed in java service.

int PRETTY\_PRINT\_INDENT\_FACTOR = 4;  
JSONObject xmlJSONObj = null;  
String outputJson = “”;

try {  
xmlJSONObj = XML.toJSONObject(inputXml);  
outputJson = xmlJSONObj.toString(PRETTY\_PRINT\_INDENT\_FACTOR);

} catch (JSONException je) {  
System.out.println(je.toString());  
}

---

<div class="post-metadata">

**Author:** ![laurent\_Faillie](https://avatars.discourse-cdn.com/v4/letter/l/7c8e57/32.png) [@laurent\_Faillie](https://techcommunity.softwareag.com/u/laurent_Faillie)\
**Post date:** [May 15, 2013, 8:42pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/6 "2013-05-15T20:42:23Z")

</div>

I’m doing the same :

- convert using documentToXMLString

- use an home made java service based on [json.org](http://json.org) to convert the result string to JSon.

But it introduce a limitation : where as having a field name containing space is valid for both wM’s documents and Json, it’s not valid for the intermediate XML …  
Only a limitation to know when building flow documents.

---

<div class="post-metadata">

**Author:** ![ryan\_bullard](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ryan_bullard/32/33384_2.png) [@ryan\_bullard](https://techcommunity.softwareag.com/u/ryan_bullard)\
**Post date:** [July 31, 2013, 12:40am UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/7 "2013-07-31T00:40:27Z")

</div>

The documenttojsonstring is putting quotes around integers. Is there a newer version of this jar or how can i access the labcase code?

---

<div class="post-metadata">

**Author:** ![Mahesh\_K\_Sreenivas](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/mahesh_k_sreenivas/32/299_2.png) [@Mahesh\_K\_Sreenivas](https://techcommunity.softwareag.com/u/Mahesh_K_Sreenivas)\
**Post date:** [March 7, 2014, 11:27am UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/8 "2014-03-07T11:27:54Z")

</div>

Hi,

IS can now handle JSON document in wM 9.5

Refer the below services:  
pub.json:documentToJSONString  
pub.json:jsonStreamToDocument  
pub.json:jsonStringToDocument

For more information refer 9-5-SP1\_Integration\_Server\_Built-In\_Services\_Reference.pdf

---

<div class="post-metadata">

**Author:** ![vachaspati\_Diwevedi1](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vachaspati\_Diwevedi1](https://techcommunity.softwareag.com/u/vachaspati_Diwevedi1)\
**Post date:** [July 6, 2015, 8:15pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/9 "2015-07-06T20:15:32Z")

</div>

what jar or methods wM IS (9.5 and above) uses for json inbuild services?

---

<div class="post-metadata">

**Author:** ![Mahesh\_K\_Sreenivas](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/mahesh_k_sreenivas/32/299_2.png) [@Mahesh\_K\_Sreenivas](https://techcommunity.softwareag.com/u/Mahesh_K_Sreenivas)\
**Post date:** [July 7, 2015, 7:43am UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/10 "2015-07-07T07:43:11Z")

</div>

> [@vachaspati Diwevedi](#):
>
> what jar or methods wM IS (9.5 and above) uses for json inbuild services?

IDataJSONCoder - wM JAVA API - Encodes an Integration Server document to JSON and  
decodes JSON to an Integration Server document.

Regarding the jars I guess it should be json-lib.jar, java-json.jar

But SAG uses Jackson java libraries for JSON implementation.

What is your requirement here?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:01pm UTC](https://techcommunity.softwareag.com/t/json-support-for-is/100385/11 "2021-04-02T15:01:53Z")

</div>


