# How to pass test data into soap web service request…? Is it possible to control the properties of soap request programmatically through a script rather than hard coding it..?

**URL:** <https://forum.katalon.com/t/how-to-pass-test-data-into-soap-web-service-request-is-it-possible-to-control-the-properties-of-soap-request-programmatically-through-a-script-rather-than-hard-coding-it/6140>\
**Category:** Miscellaneous\
**Created:** [September 5, 2017, 11:37am UTC](https://forum.katalon.com/t/how-to-pass-test-data-into-soap-web-service-request-is-it-possible-to-control-the-properties-of-soap-request-programmatically-through-a-script-rather-than-hard-coding-it/6140 "2017-09-05T11:37:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qaddaffi\_Sulaiman](https://avatars.discourse-cdn.com/v4/letter/q/da6949/32.png) [@Qaddaffi\_Sulaiman](https://forum.katalon.com/u/Qaddaffi_Sulaiman)\
**Post date:** [September 5, 2017, 11:37am UTC](https://forum.katalon.com/t/how-to-pass-test-data-into-soap-web-service-request-is-it-possible-to-control-the-properties-of-soap-request-programmatically-through-a-script-rather-than-hard-coding-it/6140/1 "2017-09-05T11:37:08Z")

</div>

I would like to know if it is possible to control the properties of a soap request through a script…? What I mean is, I do not want to hard code the properties of a soap request and I would like to read the values from a file and pass it to the properties or write a function to randomize the values for the properties.

For example, if I have a soap request with two properties, User Name and Password, I would like to pass different values to these properties, each time I call this web service request in a test case.

An example of how to do that would be much appreciated.

---

<div class="post-metadata">

**Author:** ![Qaddaffi\_Sulaiman](https://avatars.discourse-cdn.com/v4/letter/q/da6949/32.png) [@Qaddaffi\_Sulaiman](https://forum.katalon.com/u/Qaddaffi_Sulaiman)\
**Post date:** [May 22, 2017, 7:53am UTC](https://forum.katalon.com/t/how-to-pass-test-data-into-soap-web-service-request-is-it-possible-to-control-the-properties-of-soap-request-programmatically-through-a-script-rather-than-hard-coding-it/6140/2 "2017-05-22T07:53:57Z")

</div>

Hi [Vinh Nguyen](http://forum.katalon.com/author/vinhnguyenkms-technology-com/),

If it is possible, could you please provide a tutorial on how to test web services using Katalon, perhaps for a simple webservice with steps as to how to pass values dynamically and also how to parse the response data…? A tutorial on this would be highly helpful to clear the the doubts/questions.

---

<div class="post-metadata">

**Author:** ![Qaddaffi\_Sulaiman](https://avatars.discourse-cdn.com/v4/letter/q/da6949/32.png) [@Qaddaffi\_Sulaiman](https://forum.katalon.com/u/Qaddaffi_Sulaiman)\
**Post date:** [May 10, 2017, 8:28am UTC](https://forum.katalon.com/t/how-to-pass-test-data-into-soap-web-service-request-is-it-possible-to-control-the-properties-of-soap-request-programmatically-through-a-script-rather-than-hard-coding-it/6140/3 "2017-05-10T08:28:44Z")

</div>

Hi Vinh,

I tried the way you have explained, but I got the following error while running test case,

Test Cases/API\_Test FAILED because (of) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:  
file:/C:/Users/qaddaffi.sulaiman/Katalon%20Studio/AutomationTrial/Scripts/API\_Test/Script1494360124193.groovy: 29: unable to resolve class TestObjectProperty  
@ line 29, column 33.  
request.getRestParameters().add(new TestObjectProperty(“username”, ConditionType.EQUALS, username))  
^

file:/C:/Users/qaddaffi.sulaiman/Katalon%20Studio/AutomationTrial/Scripts/API\_Test/Script1494360124193.groovy: 30: unable to resolve class TestObjectProperty  
@ line 30, column 33.  
request.getRestParameters().add(new TestObjectProperty(“password”, ConditionType.EQUALS, password))  
^

2 errors

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

The screenshot of the code is at [http://prntscr.com/f6417b](http://prntscr.com/f6417b)
