cancel
Showing results for 
Search instead for 
Did you mean: 

Adding multiple query parameters while creating Test recipe for SOAP

New Contributor

Adding multiple query parameters while creating Test recipe for SOAP

Is there an option to add multiple query parameters as a list? Is there a predefined function for the same in the updated version?
Currently, I'm able to add parameters one by one using the withPathParameter(path, value) function as shown in the following code snippet:

 

SoapRequestStepBuilder sp=new SoapRequestStepBuilder();
TestRecipe recipe = newTestRecipe()
.addStep(sp.withWsdlAt(wsdlurl)
.named("SOAP")
.forBinding(strBinding)
.forOperation(strServiceOperation)
.withParameter(strParameter, strValues)
.withPathParameter(strPath, strPathValue).withPathParameter(strPath, strPathValue)
.assertXPath(ParameterName, Value)
)
.buildTestRecipe();

 

Please suggest an alternative for the same.

2 REPLIES 2
Staff

Re: Adding multiple query parameters while creating Test recipe for SOAP

Hi!

 

so you are essentially looking for a 

 

withPathParameter( String path, List<String> values )

 

method ?

 

/Ole

New Contributor

Re: Adding multiple query parameters while creating Test recipe for SOAP

I'm currently able to work with SOAP web service that is taking two parameters (e.g. http://www.webservicex.com/globalweather.asmx?op=GetWeather)
using the snippet below:
TestRecipe recipe = newTestRecipe()
.addStep(sp.withWsdlAt(wsdlurl)
.named("SOAP")
.forBinding(strBinding)
.forOperation(strServiceOperation)
.withParameter(strParameter, strValues)
.withPathParameter(strPath, strPathValue)
.assertResponseTime(intParam)
).buildTestRecipe();

 

What if we need to use a web service that takes more than two parameters?
With the available functions, we need to add multiple .withPathParameter(strPath, strPathValue) one by one.
We need to work with different web services that take more than two parameters as well.
Is there an alternative to using .withPathParameter(strPath, strPathValue) multiple times?

New Here?
Join us and watch the welcome video: