Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SoapUI REST webservice mock with path parameters

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?

like image 731
Eduardo Z. Avatar asked May 18 '16 22:05

Eduardo Z.


1 Answers

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.enter image description here

like image 193
Suman g Avatar answered Jan 02 '23 18:01

Suman g