|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
STRING OF JSON ARRAY TO XML |
« View previous topic :: View next topic » |
Author |
Message
|
HSarwan |
Posted: Wed Mar 03, 2021 6:43 am Post subject: STRING OF JSON ARRAY TO XML |
|
|
Novice
Joined: 14 Feb 2021 Posts: 11
|
Hello,
soap request node out terminal gives blob message and after cast to char it's value is :
Code: |
<castVar>"[\r\n {\r\n \"CardType\": 6,\r\n \"ReferenceNo\": \"01112230000012\",\r\n \"RU_code\": \"R\",\r\n \"DueDate\": \"22022021\",\r\n \"BillMonth\": \"FEB-21\",\r\n \"Name\": \"SSO 132 GRID STATIONZIKAR ULLAH SHAH\",\r\n \"Address\": \"GRID STATION D-I RAIWIND\",\r\n \"AmountWithInDue\": 88,\r\n \"AmountAfterDue\": 95,\r\n \"CustID\": 8471359\r\n }\r\n]"
</castVar>
|
how to get individual value in xml element tree like:
<data>
<CardType>6</CardType>
.
.
.
.
</data> |
|
Back to top |
|
 |
timber |
Posted: Thu Mar 04, 2021 3:41 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
You need to parse the value of castVar using the JSON parser. Something like this:
Code: |
CREATE outRef REFERENCE TO OutputRoot.XMLNSC.root;
CREATE LASTCHILD OF outRef
PARSE <reference to SOAP Body>.castVar DOMAIN 'JSON'; |
You should get away without the CCSID parameter in the PARSE clause because you are parsing a CHARACTER variable, and the CREATE...PARSE statement automatically assumes UTF-16 in that situation. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|