Last week, we setup our SOAP testing using SoapUI. This provides us a way to see how our API responds to various OptionObject2015 configurations. There is another tool that can be used called Postman. Depending on your context you may prefer this tool over SoapUI. This week, we will walk through the same process using Postman instead.
When we left off, we had created our first Hello World ScriptLink API in .NET using C# and Visual Basic. If we created them correctly, the we should be able to call the RunScript method with the HelloWorld parameter and receive an Error Code 3 with the ErrorMsg “Hello, World!” Let’s test that.
What You Will Need
To complete this walkthrough, you will need the following:
- Visual Studio Community 2019.
- The Hello World solution we set up previously.
I will be using the C# solution for my examples, but the process is the same for the Visual Basic solution. - Postman.
Visual Studio Community 2019 and Postman are free to download and use. Paid versions will add additional features that we will not use in this walkthrough.
If you don’t have your Hello World API setup yet, go back to my previous article to set it up.
Start Your Web Application
Our first step is to open our solution in Visual Studio and run it.
- Launch Visual Studio 2019.
- Open our ScriptLink demo solution. For me, it is RS.ScriptLinkDemo.
- Press F5 to begin debugging the solution.
- You may receive a security alert like this. This means that the browser does not trust the SSL certificate provided by Visual Studio. Go ahead and proceed.

- If you see the default homepage of our web application like this, then you will need to enter the path to the ScriptLinkController.

- Once you are at your ScriptLinkController API you should see a screen like this.

- Confirm and copy the URL of your WSDL. Mine is: http://localhost:####/api/v3/ScriptLinkController.asmx?WSDL

Setup Requests in Postman
Next, we will launch SoapUI and import our WSDL into a new test project.
- Launch Postman.
- Select File->Settings.
- If SSL certificate verification is on, turn off. This will prevent Postman form working with our self-signed certificate from Visual Studio.

- Select New in the Task bar and Select Collection.

- Enter a Collection Name and optionally a description.
- Select Create.

- Once created, select Add requests from your collection’s documentation pane.

- Enter GetVersion as the Request name and optionally a description.
- Select Save to [Collection Name].

- Add another request named Default Request.

- Expand GetVersion and select Open in builder.
- Paste the WSDL URL into the Enter request URL field.
- Set the request method to POST.
- Select Body->raw and set the body type to XML.
- Enter your SOAP request XML as follows.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:GetVersion/>
</soapenv:Body>
</soapenv:Envelope>
- Select the Header tab and change the Content-Type to text/xml.
- Open the Default Request in builder.
- Paste the WSDL URL into the Enter request URL field.
- Set the request method to POST.
- Select Body->raw and set the body type to XML.
- Enter your SOAP request XML as follows.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:RunScript>
<tem:optionObject2015>
<tem:EntityID>?</tem:EntityID>
<tem:EpisodeNumber>0</tem:EpisodeNumber>
<tem:Facility>?</tem:Facility>
<tem:Forms>
<!--Zero or more repetitions:-->
<tem:FormObject>
<tem:CurrentRow>
<tem:Fields>
<!--Zero or more repetitions:-->
<tem:FieldObject>
<tem:Enabled>?</tem:Enabled>
<tem:FieldNumber>?</tem:FieldNumber>
<tem:FieldValue>?</tem:FieldValue>
<tem:Lock>?</tem:Lock>
<tem:Required>?</tem:Required>
</tem:FieldObject>
</tem:Fields>
<tem:ParentRowId>?</tem:ParentRowId>
<tem:RowAction>?</tem:RowAction>
<tem:RowId>?</tem:RowId>
</tem:CurrentRow>
<tem:FormId>?</tem:FormId>
<tem:MultipleIteration>0</tem:MultipleIteration>
<tem:OtherRows>
<!--Zero or more repetitions:-->
<tem:RowObject>
<tem:Fields>
<!--Zero or more repetitions:-->
<tem:FieldObject>
<tem:Enabled>?</tem:Enabled>
<tem:FieldNumber>?</tem:FieldNumber>
<tem:FieldValue>?</tem:FieldValue>
<tem:Lock>?</tem:Lock>
<tem:Required>?</tem:Required>
</tem:FieldObject>
</tem:Fields>
<tem:ParentRowId>?</tem:ParentRowId>
<tem:RowAction>?</tem:RowAction>
<tem:RowId>?</tem:RowId>
</tem:RowObject>
</tem:OtherRows>
</tem:FormObject>
</tem:Forms>
<tem:NamespaceName>?</tem:NamespaceName>
<tem:OptionId>?</tem:OptionId>
<tem:OptionStaffId>?</tem:OptionStaffId>
<tem:OptionUserId>?</tem:OptionUserId>
<tem:ParentNamespace>?</tem:ParentNamespace>
<tem:ServerName>?</tem:ServerName>
<tem:SystemCode>?</tem:SystemCode>
<tem:SessionToken>?</tem:SessionToken>
</tem:optionObject2015>
<tem:parameter>?</tem:parameter>
</tem:RunScript>
</soapenv:Body>
</soapenv:Envelope>
- Select the Header tab and set the Content-Type to text/xml.
- You should now have both of your requests configured and ready to test.

Ok. Let’s run some tests.
Testing the API
For our first test, we are going to see what happens when we submit the GetVersion request.
Test #1: GetVersion
Our first test will be relatively straightforward. We want to get our GetVersion string back. When we created the SOAP project, SoapUI created default requests for us.
- Select the GetVersion tab.
- You should now see our XML request displayed and ready for submission.

- Select Send to submit request.
- You should have received an XML response.

If the test was successful, then you should see the version number you set previously displayed in the GetVersionResult tag. If not, make sure your web application is still running.
Test #2: Submitting Default OptionObject
Ok. Now for the real test.
- Select the Default Request tab.
- You should now see our XML request displayed and ready for submission.

- Select Send to submit the request.
- You should have received an XML response with the ErrorCode “3” and the ErrorMesg “Hello, World!”

Save Your Postman Requests
To help with future testing, let’s save our Postman request. You can close each tab and select Save changes. This should eliminate the need to configure the request again, unless we change ports.
Happy Testing
There you go. You are all set to set testing your ScriptLink APIs with SoapUI. Enjoy!
One reply on “Testing Your ScriptLink API with Postman”
[…] my previous articles, we setup SoapUI and Postman to test the responses to our submissions. While this is an important testing method, it is time […]
LikeLike