Ask a Question

Downloading a JSON file after hitting soap UI https request


Re: Downloading a JSON file after hitting soap UI https request

Hi @sparrowenclave,


Here is a sample script to browse a directory containing json files and open each to find a specific node.


import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import static;

File newFile;
String FolderPath = "<insert your path here>";
File selectedDirectory = new File(FolderPath);
List<Path> paths = new ArrayList<>();

try {
  paths = Files.walk(Paths.get(new File(selectedDirectory.getPath())
              .filter(p -> p.toFile().isFile())
} catch (IOException e) {

for (Path path : paths) {
  newFile = new File(path.toString());
  ObjectMapper mapperFileSource = new ObjectMapper();
  JsonNode rootNode = null;
  try {
      rootNode = mapperFileSource.readTree(newFile);
  } catch (IOException e) {
  JsonNode searchNode = rootNode.findValue("<insert a node name here>");
  if (searchNode != null) {;
      // You can add assertions here


It is just an example of what can be done.

Keep in min you'll need jackson's library.
Hope this will help.



Community Hero

Re: Downloading a JSON file after hitting soap UI https request


This is great...people ask for this every so often and now there's a definite way of doing it. I'll be saving this for when this pops up in my work, so nice one!

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Showing results for 
Search instead for 
Did you mean: