SoapUI REST webservice mock with path parameters - rest

I am trying to create a mock webservice for a POST method on SoapUI. I made a REST Project, then created a MockService, a MockAction and defined a couple responses and resource paths. It works fine if I define a fixed regular path relative to my Service, for example method/postmethod to be invoked at http://localhost:8080/method/post, it works well.
What I want to do, however, is define my method with path parameters, such as this: http://localhost:8080/method/{par1}/{par2}/{par3}/post. The application we want to test, which will be invoking our mock service, uses this type of parameter extensively, so we cannot just create one method for each possible combination.
Is it possible to define a mock POST method with that type of path parameter? Is it possible to parse the parameters and use them in the output response? If yes, then how?

Please enable the script method in responding the request that came to mock, there is a default script posted by soapui , which tells how to access the path parameters, headers, body . please use that , attached the pic for reference.

Related

Reverse Engineering an auth code query parameter passed to Play Framework in URL query Parameter

I recently got thrown into a company to do DD on a SaaS solution that needs to generate codes to send invites. Has anyone seen or used this method of passing an API key/auth code? It's using the Play Framework. I don't have access to the play source code, just a compiled binary so I can't even see how the GET request is validated.
Eg:
https://<site.com>/?auth=10002-1644542228446-75ac043770463c36039f29d75304171c
I checked the packages used and there is io.jsonwebtoken.jjwt-0.9.1.jar used but I'm only familiar with passing it as a header "Bearer ". and haven't seen this three segmented formatting. XXXXX-XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Any help would be appreciated. I know it's not a lot to go off but I'm only looking to be pointed at the method used to get started.

Claudia.js jasmine post/put body key

I'm using claudia-api-builder and attempting to write tests using jasmine-node. I'm using the proxyRouter on my API using this tutorial https://claudiajs.com/tutorials/testing-locally.html, and I can pass path parameters fine as demonstrated. However, I can't find what the key is for the body of the request.
For example it says
You can fill in the other properties (eg queryStringParameters)
according to what the test expects
But I can't find anywhere that lists the possible properties. The API Gateway Proxy Object link also doesn't seem to go to anything useful, as the sample doesn't seem to include a body.
Does anybody know what the key I should be using is? Thanks!
Worked it out - somewhat embarrassingly it's just body.

How to use Fiddler to check response codes of multiple URLs ?

Please suggest how to use the composer. Is there a way I can just input a file with a list of URLs and have fiddler check those links for me ?
There's no built-in feature that performs exactly that function, but you can easily write script that does this. Use the utilIssueRequest method on the Proxy object to send a request to a target URL. See http://www.fiddler2.com/fiddler/dev/scriptsamples.asp for a full script example.

SoapUI TestCase - How to extract raw response string for the second step

I use SoapUI to make a simple test:
Call a REST service (POST) which returns me something like
"key:value"
Call a web service (SOAP) with one of the element = the value from step 1
I just search the SmartBear Forum and the SoapUI documentation but did not find how to extract the response, like it would be similar to ${myFirstStep#Response/rootelement/element} if it was XML. But the REST response is not XML (then I guess xpath function does not apply in my case).
I would prefer a solution without scripting if possible. Is there a SOAPUI documentation about these variable parsing? I did not find it on SoapUI site
EDIT: a Groovy script solution would be perfect if someone have a idea how to make it. I checked the Groovy documentation on the soapui site but I do not find what I want.
If your rest response is in JSON Format you can change it in XML format..and if you dont want to change it in xml format you can use property transfer step in pro version there you will see a option to choose ReponseAsXml in property box of source.Then you can write your normal Xpath to transfer that property.Its very simple.
Or even by right clicking on your node in Pro version you can directly transfer that node any where in your testcase.But its pro feature.Best way to do it in soapui free version change your response in Xml format.

how works kWebServiceURL?

I read some code with this kWebServiceURL(#"somepage.php"). How works this function?
Thank you
looks like a custom function. search the code you are using that in. It may be that they are creating a web service url out of the string being passed in.