Intro
This short tutorial is a small showcase of how to use the Coded Workflows feature in Studio to send your SOAP request. For added fun, we will also use the Generate Code functionality to skip the writing code part
As far as examples that we could work on, we can choose any service from the following Postman collection.
With the intro behind us, let’s jump straight to it.
If you’d like to learn a bit more about the basics of Coded Workflows, please refer to my previous tutorial on how to Replace Invoke code by invoking Coded Workflows inside your project, or consult our documentation over here.
Step 1 - ask Studio to generate your sample SOAP request
The first step would be to try and ask Studio to provide you with the required code snippet. In this case, the prompt was rather simple:
sample synchronous SOAP request
And the result looked like this:
Step 2 - fill it with the missing data
In our example, we want to issue the request to this URL: http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso
, and with the following payload:
@"<?xml version=""1.0"" encoding=""utf-8""?>
<soap12:Envelope xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">
<soap12:Body>
<ListOfCountryNamesByName xmlns=""http://www.oorsprong.org/websamples.countryinfo"">
</ListOfCountryNamesByName>
</soap12:Body>
</soap12:Envelope>";
To do that, we can simply replace the automatically generated placeholders like so:
Step 3 - run the automation!
We are done here. We can run the automation and observe the results in the output panel:
Project files
You can download the sample project below:
SOAP Request and Coded Workflows.zip (3.3 KB)
What do you think?
Feel free to share your feedback. Our team is always listening