I have to compare my WebService response with its downstream service. But, the IDs in my response and downstream response are not identical. I am giving sample responses below. And again, one is a REST service and another SOAP service, however i can do typeconversion (Thats not an issue)
MyWebService Response:
"myWebServiceResponse": {
"webServiceSummary": {
"service": {
"serviceCd": "ABCD",
"serviceDescription": "Checking Main Service",
"hypotheticalInd": "100.0",
"realInd": "200.0"
},
"includeServicesList": [
{
"serviceCd": "XYZ",
"serviceDescription": "Checking AddOn Service",
"hypotheticalInd": "50.0",
"realInd": "60.0"
},
{
"serviceCd": "PQRS",
"serviceDescription": "Checking SecondAddOn Service",
"hypotheticalInd": "100.0",
"realInd": "200.0"
}
]
}
Now, below is downstream service response. I cannot use 'match contains' because IDs in myWebServiceResponse and DownstreamService are different and also there are many extra parameters. You can see below.
DownstreamServiceResponse:
"myDownstreamResponse": {
"webServiceDetail": {
"feature": {
"featureCd": "ABCD",
"featureName": "Checking Main Service",
"imaginaryInd": "100.0",
"actualInd": "200.0",
"extraInd1": "someRandomValue1",
},
"includefeatureList": [
{
"featureCd": "PQRS",
"featureName": "Checking SecondAddOn Service",
"imaginaryInd": "100.0",
"actualInd": "200.0",
"extraInd1": "someRandomValue1",
"extraInd2": "someRandomValue1"
},
{
"featureCd": "XYZ",
"featureName": "Checking AddOn Service",
"imaginaryInd": "50.0",
"actualInd": "60.0",
"extraInd1": "someRandomValue1",
"extraInd2": "someRandomValue1"
}
]
}
Now, How am i suppose to match these two responses? Also, you can see that few parameters are random and cannot be compared by moving line by line. Only identical parameters values assigned to CDs/Indicators. And also, I want to know how to extract and match parameters based on one main value. For example, i want to take "serviceCd" : "ABCD" and compare all parametes related to ABCD with that of downstream service.
See Question&Answers more detail:
os