on 08-29-2016 7:32 AM
Hi All,
i have issue in XML to JSON array conversion
if there is 1 line item in array Square brackets are not being generated
if there are multiple line items same settings are working fine
we are on 7.4 sp8. and dont have rest adapter
we can use only receiver soap adapter and adapter modules for the entire config.
JSON ARRAY
Message type
XML before conversion
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_LogError_Reqxmlns:ns1="http://Mahindra.corp/xi/SHIFTB_LogError">
<header>
<linkedAccountId> 0</linkedAccountId>
<sapCreatedAt>08/24/2016 01:19:02</sapCreatedAt>
<complaintSubType>INVALID FILE NAME</complaintSubType>
<description>Filename:CustomerMaster/NewProfiles-23-08-2016.csv-is Invalid</description>
<linkedUserId> 0</linkedUserId>
<linkedJobId></linkedJobId>
</header>
</ns1:MT_LogError_Req>
It is getting converted to the below json structure after conversion
{
"header":
{
"linkedJobId": "",
"linkedAccountId": " 0",
"description": "Filename:CustomerMaster/NewProfiles-23-08-2016.csv-is Invalid",
"complaintSubType": "INVALID FILE NAME",
"linkedUserId": " 0",
"sapCreatedAt": "08/24/2016 01:19:02"
}
}
Required structure
{
"header":
[
{
"linkedAccountId": "",
"sapCreatedAt": "08/23/2016 01:38:09",
"complaintSubType": "FILERETRIEVALERROR",
"description": "Day end reconciliation failure, SmartShift day end balance Rs. 78, SAP day end balance Rs. 85. UserID XXXXX. Please verify and correct",
"linkedUserId": "4525079564124160",
"linkedJobId": ""
}
]
}
Kindly share your suggestions
Thanks
Kavitha
What is the adapter module you use the XML to JSON conversion? Is it a standard module ( I am not aware of any though ) or is it a custom module?
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.