0

I am new to the SOAPUI and have created few rest mock services in it. Now I have two separate rest mock services which do not interact with each other but are under the same project in SoapUI.

The only commonality between these two services is one UID, which is passed to both services, Now I want to save some status along with the UID on first web services and want to find the status of the first web service based on that UID in the second service.

So is there any way in which I create a map like data structure in SoapUI which can be shared across multiple mock services?

2 Answers 2

0

In the first Request, we will use the following statement

mockOperation.mockService.project.setPropertyValue(UID,”xyz”)

In the second Request, we can simply get the value of UID using the following statement:

def value = mockOperation.mockService.project.getPropertValue(UID)
0

I'm not really sure what the issue is here and this answer contains a number of assumptions.

In SoapUI, you define the services in the API under test. You can call/execute these, but there's not much benefit aside from making sure they are set up. By defining them, you are creating 'blocks' that you can put together to build your tests.

For example, you may have a getUser service. You define this at the root of the project. Then you use that definition is any number of tests.

Reading between the lines of your question, it seems you have defined the services, but you have not created a test.

In your test you can 'add' steps. A step might be a Groovy script, a JDBC call, or a call to a service (which has been defined in the root of the project).

So, for your example,

The test steps might be....

  • call Service one
  • a piece of groovy script to pull the UID from service one
  • call Service Two and pull the result of the groovy script and add it into the payload

I don't think you need to set custom properties. SoapUI offers many ways to call subsequent services with values returned from earlier service calls in your test.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.