AnsweredAssumed Answered

REST Virtualization with complex JSON Payload

Question asked by MallikarjunMelagiri1 on Nov 2, 2017
Latest reply on Nov 2, 2017 by Vinay Nagariya

monika_mehta

 

I need to do the REST virtualization with RR pairs. The request file is as follows:

 

POST /air-shopping/carInsurance.action HTTP/1.1
Content-Type: application/x-www-form-urlencoded

 

{"carJson":"{"carDesc":{"carModel":"Honda","isBlack":false,"hasInsurance":false},"accidentsInfo":[{"accidentCount":"1","accidentTypeCode":"MINOR"}],"bundled":false,"searchType":"SEARCH","appName":"CAR-INS","shopPreferenceType":"PRICE","filterSearch":false,"searchedSlices":[{"date":"2017-11-01","origin":{"code":"ATL"},"destination":{"code":"MSP"}}],"carType":"USED","loggedIn":false,"requestedPageNumber":1,"currentSliceIndex":"0","refundable":false,"shopType":"REVENUE","fareFamily":"BE","sortCriteria":{"selectedSortType":"customScore"}}","sellerId":"carInsurance","buyerId":"carInsurance","otherId":"carInsurance"}

 

It has a Json structure payload which can be simplified as below, for better understanding:

{carJson:{SomeChildJson}

sellerId:carInsurance

buyerId:carInsurance

otherId:carInsurance}

 

My requirement is that, I should be able to set the independent key value pairs inside the {SomeChildJson} as the arguments for the VSI, so that the incoming requests can be identified uniquely and respective responses can be sent.

 

How do I do it? What data protocols to use to break it into separate arguments?@@@@@

Outcomes