Forum Discussion

karthikmv's avatar
14 years ago

Passing Response as Request

Hi All,

I have 2 json rest services my condition to test them is like, I will give request to one json service which in turn give me the response which I will use as one of the json input object for 2nd json service. For Example, My json1 has given response as 221 which I will use that and frame json object like

{id:221,name:'test Json'}


and pass it over to json2 where 221 is the response from json1. Will that be possible? Can anyone please explain?

Thanks,
Karthik
  • goutham777's avatar
    goutham777
    Occasional Contributor
    You can do this is soapui pro, no idea in free version try using property transfer pass the response from 1 request to property and use property transfer.
  • You can do this from the open version.

    Right click on the test case, and choose "Show Test Case Editor". If your test cases are in the order that you want them all you have to do is select the step that will be getting the value passed to it (the latter step). Then click the icon on the Test Steps bar that looks like a down arrow between two horizontal lines. It is the fourth icon in my installation.

    Name it something appropriate and save. This will open the editor for that property transfer. Click the top left icon to add a property. By default the transfer will select the step above it as the source and the step below it as the destination.

    You can however transfer properties to more than one destination:

    Say that you log into a service that passes back a session ID. Well you need that session for every command that you execute after that. So you will add an entry with the same property value and source, but with a different destination.
  • ALausch's avatar
    ALausch
    New Contributor
    Hi

    I am trying to achieve the same thing but am a bit confused with the answer given.

    Like the original poster, I have 2 services (one that creates an event and the other that returns the details of the created event)

    When I run the Create Event service, it returns a event_id. I need to grab this value and pass it to the event_id parameter in the Event Details service below it.

    In fact ideally I would like to carry this event_id value around to other services too as most of them need this as a mandatory parameter.

    I am using SOAP Pro.

    Kind regards

    PNE