xpath and soapui, Transfer Property. Getting nested JSON from a Get to a Post in a Test Suite

I am trying to learn SoapUI and I have not found any good guides on how to perform a transfer property from a Rest GET request to a Rest POST request.

I have the following payload returned from a REST GET request

{
"a":"a",
"b": { "b1":"b1", "b2":"b2" },
"c":"c"
}

I want to take this JSON and remove c, then submit the rest to a POST request. I wish to post

{
"a":"a",
"b": { "b1":"b1", "b2":"b2" },
}

I am trying to do all this in SoapUI, but have had no success. I am able to get individual values by saying in the source property is RseponseAsXML and the target property is Request. Then I use the command //*:a. But it only returns that value.

I do not want this to be xml though, I am working strictly with JSON. Thank you.

Best How To :

If you want to manipulate the JSON response to use in other TestStep it's easier to use groovy TestStep instead of Transfer testStep. So create a groovy TestStep and manipulate the response using the following code:

You can use an API key, however - as you wrote - it's pure protection and easily accessible value - potential abuser just needs to view the source or investigate the queries. In general REST APIs are secured with tokens. At the beginning of the session (not in traditional meaning...

As noted in the docs, .update() doesn't call the model .save() or fire the post_save/pre_save signals for each matched model. It almost directly translates into a SQL UPDATE statement. https://docs.djangoproject.com/en/1.8/ref/models/querysets/#update Finally, realize that update() does an update at the SQL level and, thus, does not call any save() methods on...

IllegalAnnotationException: Class has two properties of the same name "list" Look at your two model classes XmlMessageBean and ResponseList. Do you see any difference? The main difference (and the cause for the error), is the @XmlAccessorType(XmlAccessType.FIELD) annotation (or lack there of). JAXB by default will look for the public...

Your file is not encoded in UTF-8, and the error occurs at the fp.read() line. You must use: import io io.open(filename, encoding='latin-1') And the correct, not platform-dependent usage for joining your paths is: os.path.join(root, f) ...

You're not getting the results you want because you're not assigning the sorted user_infos back into the user_infos variable. You can do the following: user_infos = user_infos.sort {|a, b| - (a['can_go'] <=> b['can_go']) } # -or- user_infos.sort! {|a, b| - (a['can_go'] <=> b['can_go']) } The first version of sort creates...

If I believe the println of aStatus, the property title is a String, not a Dictionary. Change this part in your code (cast as String instead of as NSDictionary): if let user = aStatus["title"] as? String { println( "TITLE \(user)") } ...

$http.get is asynchronous. When cache.get or return result are executed, HTTP request has not completed yet. How are you going to use that data? Display in UI? E.g. try the following: // Some View <div>{{myData}}</div> // Controller app.controller('MyController', function ($scope) { $http.get('yoururl').success(function (data) { $scope.myData = data; }); }); You...

json["Cars"] is an array, so for example to get the first item via SwiftyJSON: println(json["Cars"][0]["Brand"].stringValue) In a JSON string, { and } are delimiters for dictionaries, whereas [ and ] are delimiters for arrays. EDIT: Following your comment, yes, you can loop over the array: if let cars = json["Cars"].array...

Create an object. Loop over the array Get the name of each member of the array Copy each member into the object using a property name that is the same as the name you just got Then just use the object instead of the array. You might want to...

I guess the answer depends on your answer to these questions: Since you can never trust ANYTHING that comes in a client request, are there any harmful effects that could come by a hacker spoofing the pojo value? By sending the object to the client, does this expose any internal...

Why move one array to another array and then echo the second array. Why not just do this function shutdown(){ $error = error_get_last(); echo json_encode($error); } Or even this function shutdown(){ echo json_encode(error_get_last()); } Apart form the use of an unnecessary array, this will give you all the information available...

You can use the jQuery when function (https://api.jquery.com/jquery.when/) to wait for all three promises to resolve. You only need to make sure you also return the promise in your nb1, nb2, nb3 functions. function nb1() { return $.post("p1.php", { action: 1 }, function(data) { console.log(data); }, "json") .fail(function(data) { console.log("error");...

You should change your row data.addColumn('String', 'sitecode'); to data.addColumn('string', 'sitecode'); (non capital "s" in "string"), of course this applies to all of your added columns. Javascript is case-sensitive....

The code you've supplied, by itself, works fine. It breaks if you try to force the use of JSONP because the server you are making the request to doesn't support that. It does support CORS (which is the modern replacement for JSONP), and you don't need to do anything special...

You want to return json object in response, so it's required to set json type in response header. As given here public function select(){ $data['query'] = $this->users->select(); $this->output ->set_content_type('application/json') ->set_output(json_encode($data['query'])); } It is required to encode part as below for insert part. so you can use this generated url to...

Ok, you'll want to check out Structuring your application. You'll have to make the file with the definition load earlier, or the one with the fixture later. Normally you have your collections inside lib/ and your fixtures inside server/fixtures.js. So if you put your insert code into server/fixtures.js it'll work....

the first "A" in AJAX stands for "Asynchronous" that means, it is not executed right after it has been called. So you never get the value. Maybe you could first, get the os list and then output what you need, like this: function createCheckBoxPlatform(myDatas) { $.ajax({ url: "/QRCNew/GetOS", type: "post",...

No, you don't need to use .nest here. The easiest way to build the required data structure is as you suggest (d3 always wants an array to iterate over): var nestedData = [ years[0].chartOne, years[0].chartTwo ]; After that, it's as simple as cleaning up the accessor functions for your data...

DO include absolute entity URIs in your responses (such as /customers/12 or even http://www.example.com/customers/12). DO NOT include just an entity's ID (such as 12) in a response, because that way you're forcing clients to put together resource URIs themselves. In order to do that, they would need to have prior...

Try to separate API from your application logic. From API you GET the quote and API from now on shouldn't care what you do with that data. The same with marking quotes as favorites. It's your application's and user db's problem how to mark something. Again, API should care only...

First off, your associative array is flipped. You need to change array($wholeNumber['DocumentNbr'] => 'Number', $wholeNumber['DocumentRevision'] => 'Revision'); to array('Number' => $wholeNumber['DocumentNbr'], 'Revision' => $wholeNumber['DocumentRevision']); You need that in order to access the elements of the JSON. Then, in your loop, you would use wholeNumberData[i].Number to get the number and wholeNumberData[i].Revision...

The issue is with the dependencies that you have in pom.xml file. In Spring 4.1.* version the pom.xml dependency for Jackson libraries should include these: <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.4.1</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.4.1.1</version> </dependency> You...

You just need to POST data to your server. Port could be anything you want, should be 80. Host your script with a domain url so that you can make network request publicly. You can try this function: -(NSData *)post:(NSString *)postString url:(NSString*)urlString{ //Response data object NSData *returnData = [[NSData alloc]init];...

obj.roles[0] is a object {"name":"with whom"}. you cant replace string with object. you need to refer to property "name" in the object obj.roles[0].name Another problem is that var finalXML get a new value every line. you need to add a new value to the variable, not replcae it. var finalXML...

To me it just seems a bit light, visit this link https://msdn.microsoft.com/en-us/library/office/dn769086.aspx on technet, and compare your upload function to this: // Add the file to the file collection in the Shared Documents folder. function addFileToFolder(arrayBuffer) { // Get the file name from the file input control on the page....