Forum Discussion

divya_26's avatar
divya_26
Occasional Contributor
4 years ago
Solved

How to use value from jdbc response into the json payload for a web service in soap ui free version

Hi Guys, I am working on Soap ui oopen source. I have used sql query and i am getting xml response. Now I want to use one its response as an input in request parameter for testing a web service(i am...
  • nmrao's avatar
    nmrao
    4 years ago
    Since there are 3 id's (of course, there can be many as well), the following rest step has to be repeated, correct?
    Need to write a script.
  • nmrao's avatar
    nmrao
    4 years ago

    divya_26 

     

    Here is a sample project.

    https://github.com/nmrao/sample-soapui-projects/blob/master/rest_sample/demo-loop-soapui-project.xml

     

    This project has a mock service to test the use case. But you can use it and apply to your case.

    There is one Test Suite and a Test Case. And a mock service. First you need to start it by right click. Then select the test case and run.

     

    Please note that

    1. Since it is not possible to mock jdbc step (GetJDBCResponse) , used REST test step. However, that receives same response as JDBC and response is dynamic number of both rows and ids in each call. So, in your case, this step is not required.

    2. Step 2 (Conditional Goto) will check if there are any IDs in response. It will jump to Step Continue if no IDs found in the response. You need use this step.

    3. Step 3 (DataSource) will extract data from Step1 (JDBD response) and set one ID in custom  properties at test case level. This step also saves rest of the ids. You need to use this step

    4. Step 4 (POSTRequest) . You need not to use, instead use your request.

    5. Step 5 (Loop) this step will get the ids and take next one and execute Step 4. This is continued until all ids post request is sent.

     

    Please check sample screen