Table of contents
This tutorial describes how to design a virtual user containing SOAP requests. It will show you three different ways of creating SOAP requests in NeoLoad: from a WSDL file, from scratch, or from a recording sequence.
To gain the most from this tutorial, it is recommended to have read the section on section "SOAP requests" beforehand.
In the same way NeoLoad let's you define and load test HTTP interactions, NeoLoad provides the means to load test SOAP requests. SOAP requests are in many ways similar to pure HTTP requests. This means that all the features NeoLoad provides for HTTP requests will be available for SOAP. This includes, among others, using variables, defining validation expressions and of course obtaining load test results. However it is worthy to note that SOAP requests differ from HTTP request in several ways:
SOAP requests may not be associated to an HTML page the way HTTP requests are. If you record an HTML page containing SOAP requests, these requests will be recorded and associated to the page. On the other hand, if you record only SOAP requests, they will appear as standalone requests. More on this subject in the section called “Recording a SOAP Request”.
Not belonging to an HTML page, independent SOAP requests have no associated Think Time. If you want to test a sequence of SOAP calls, it is up to you to define delay actions to simulate latencies. For more details on delay actions see the reference guide.
The way NeoLoad displays results differ from HTML pages and HTTP requests. More on this subject in the section called “A Quick Tour on Analyzing SOAP Results”.
NeoLoad provides three ways of defining a SOAP request and are covered by one of the following sections:
Our first example will use a web service provided by StrikeIron, this service is a Text Disguise CAPTCHA-Image service. Provided you register your email you'll be allowed to freely test the service. The WSDL is available at http://ws.strikeiron.com/textdisguise/CaptchaService?WSDL.
A CAPTCHA ("Completely Automated Public Turing test to tell Computers and Humans Apart") is a program that can generate images that most humans can see, but current computer programs can't. Many applications need the security of knowing that the "thing" interacting with them is, in fact, a real live person capable of thinking who is responsible for the interaction. Text Disguise solves this problem by embedding a word into an image, distorted and is then shown to the user. The user has to confirm the value entered into the box to continue.
The Text Disguise CAPTCHA-Image service defines two basic methods
called GetNewWord and
ValidateImageWord. The first method,
GetNewWord, expects no direct arguments. It returns a
captcha image identifier and a link to that image. The image can be
displayed and the user prompted to enter the text he or she sees in the
image.

The second method, ValidateImageWord, expects two
arguments, the text entered by the user and the image identifier. The
method returns true if the text is consistent with the image identifier
and false otherwise.
The HTTP request containing a call to the
GetNewWord method looks like the following:
POST http://ws.strikeiron.com/textdisguise/CaptchaService
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.textdisguise.com/TextDisguise/CaptchaService/GetNewWord"
User-Agent: Jakarta Commons-HttpClient/3.0
Host: ws.strikeiron.com
Content-Length: 723
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:LicenseInfo
xmlns:ns1="http://ws.strikeiron.com"
soapenv:actor="" soapenv:mustUnderstand="0">
<ns1:UnregisteredUser>
<ns1:EmailAddress>john.doe@dot.com</ns1:EmailAddress>
</ns1:UnregisteredUser>
<ns1:RegisteredUser>
<ns1:UserID/>
<ns1:Password/>
</ns1:RegisteredUser>
</ns1:LicenseInfo>
</soapenv:Header>
<soapenv:Body>
<GetNewWord
xmlns="http://www.textdisguise.com/TextDisguise/CaptchaService/">
<GetNewWord/>
</GetNewWord>
</soapenv:Body>
</soapenv:Envelope>Several points are worth noticing:
The HTTP request header defines the end point of the method, the
address where the service resides, in our example this is
http://ws.strikeiron.com/textdisguise/CaptchaService.
The HTTP request header contains a SOAPAction
item.
The HTTP request defines a text/xml content type.
The SOAP header, soapenv:Header element,
expects an nsl:unregisteredUser element that must
contain your email address.
The SOAP body, soapenv:Body element only
contains a reference to the invoked method
GetNewWord and has no parameters.
The previous points are noteworthy because most of these elements are generated by NeoLoad and based on the WSDL definition, but as detailed in the following section, NeoLoad's user interface will let you customize and configure all of them.
The following procedure describes the steps involved in creating a new SOAP request:
Creating and defining the SOAP request based on WSDL definition
Configuring the request (parameters)
Testing the request
Creating a SOAP Request
Select Design
mode
Click on the
button.
Create a new virtual user
Right-click on the Virtual User profiles
node and select New Virtual User. Enter
"VirtualUser", then click
"OK".
Add a new SOAP request
Right-click on the virtual user just created and select
"Insert into", then "SOAP
request".
Create the request from a WSDL definition
Check the Generate request using a WSDL
file option and enter the URL of that file. In our
example the URL is:
http://ws.strikeiron.com/textdisguise/CaptchaService?WSDL.
NeoLoad analyzes the WSDL and extracts the methods that can be
called.

Click Next.
Select the method to call
Based on the WSDL's definition, NeoLoad lists the methods
that you can choose from. Here, we'll select the
CaptchaServiceSoap.GetNewWord method.

Click Next.
Define a request name
NeoLoad provides a default request name which it usually derives from the method name defined in the WSDL. Most of the time you won't need to change this name. You might want to change it if you use this call several times with different parameter and configuration values.

Click Next.
Define the service end point
This steps lets you define the address for invoking the specified service. The WSDL includes this URL and most of the time you won't need to change this address. You might want to change the endpoint to switch from a test environment to a production one.

Click Finish.
Check the main configuration elements
At this point, the SOAP request is added to the virtual user.

NeoLoad's right panel displays the main configuration
elements of the SOAP request. This includes the end point URL
which is defined by both the Server and
Path elements. These elements, as mentioned
earlier, have been extracted from the WSDL but can be changed to
custom values. As with HTTP requests, the Path
element can been defined using NeoLoad variables.
The WSDL element can equally be changed
or reloaded. Reloading is particularly useful when the SOAP
request and it's associated WSDL are out of sync.
![]() | Warning |
|---|---|
Reloading WSDL will re-initialize all previous configuration elements. All previously defined parameters will be lost. |
Check the HTTP headers
Most SOAP request require at least two HTTP header elements
when SOAP is tunneled through HTTP. Always make sure that these
elements are correctly set. They are available in the
Advanced parameters dialog and are accessed by
selecting the
button:

In our example these elements are
ContentType and SOAPAction.
If your web service framework requires additional HTTP header
elements you can set them in the Advanced
parameters dialog.
Configuring the SOAP request
Before actually testing the SOAP request, additional elements
including parameter values and encoding types must be configured.
Select the
button to access the SOAP configuration
dialog.
Define the main parameters of the SOAP body
The Parameters tab let's you define the
structure of the SOAP body. The tree structure in the left most
panel of the SOAP Parameters dialog displays
the structure and content of the SOAP body.
As mentioned earlier, the GetNewWord
method expects no parameters or an empty so the tree only has one
root element called GetNewWord (an empty
element as defined in the WSDL). Had there been several elements
or several possible elements, NeoLoad would have displayed them in
the tree. In our example no further configuration for the body is
necessary.

Define the SOAP header
Select the Headers tab to define and
configure elements related to the SOAP header. The SOAP header
elements are presented in exactly the same way as the SOAP body
elements are. The left most panel contains an XML tree displaying
the structure and contents of the header of the SOAP envelope.
Adding and removing elements is achieved using the
and,
buttons. Moving elements around is achieved
using the
and
buttons
The structure contains either container elements, such as
UnregisteredUser in our case, or leaf elements
such as EmailAddress. Container elements are
meant to contain other elements. Right
clicking on them will pop up a menu from which you can choose to
move the selected element or add and remove child elements.
NeoLoad will only suggest child elements that are consistent with
the WSDL definition.
Leaf elements on the other hand cannot contain other
elements but have an associated value. In our example you must
enter a valid email address for the
EmailAddress element.

For both container and leaf elements, you can define
attribute names and attribute values. Again attributes must be
consistent with WSDL definition. Encoding
allows special characters such as '>', '<' or '&' to be
encoded.
Configure advanced settings
The Advanced Settings panel let's you
configure the binding styles of the SOAP request and the format of
attachments. This information has been extracted from the WSDL and
you should definitely be familiar with the types of bindings if
you decide to change this setting.

View XML
The last tab of the SOAP Parameters
dialog displays the actual XML content that will be sent. NeoLoad
generates its content on the fly using the XML elements and
attributes you have defined. Right clicking on the XML and
selecting the Format as Pretty XML item will
display a neatly indented XML.

![]() | Tip |
|---|---|
You can search the generated XML for a particular
expression by right clicking on the XML and selecting the
|
Testing the SOAP request
By creating a temporary virtual
user, NeoLoad provides an easy and quick method to check
your SOAP request. Select the
button to open the Check Virtual
User dialog.
Start checking
If you have already tested Virtual Users using NeoLoad you
will be familiar with the following dialog. By selecting the
Start checking button, NeoLoad will generate
the SOAP request and send it to the specified end point. NeoLoad
displays the associated response code and the number of failed
assertions for the sent request. When the line associated to the
request is selected the dialog displays further details in the
lower part of the dialog. You can choose to display the SOAP
request that was sent or the XML response.

![]() | Tip |
|---|---|
You can search the SOAP request or the XML response for a
particular expression by right clicking on the XML and selecting
the |
![]() | Tip |
|---|---|
You can neatly format SOAP request or the XML response by
right clicking on the XML and selecting the |
If you are following our example and testing it, the first time you'll send the request the response will look like the following (the HTTP header has been omitted):
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header/>
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>
Thank you for your attempt to try this Web service. Before the
free trial can occur,
you must first validate your email address.
Simply click on the link in the email that was just sent to you,
and you will then be able to invoke every Web service
within the StrikeIron Web Services Marketplace, including this one.
</faultstring>
<faultactor/>
</soap:Fault>
</soap:Body>
</soap:Envelope>As indicated in the faultstring element,
all you need to do to use the service a limited amount of times is
to validate the email address you sent by following the link that
StrikeIron has sent to you. Once your address is validated
invoking the service should get you a response such as the one
that follows (the HTML header has been omitted):
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Header xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<SubscriptionInfo xmlns="http://ws.strikeiron.com">
<LicenseStatusCode>1</LicenseStatusCode>
<LicenseStatus>Valid key</LicenseStatus>
<LicenseActionCode>0</LicenseActionCode>
<LicenseAction>Decremented hit count</LicenseAction>
<RemainingHits>4</RemainingHits>
<Amount>0</Amount>
</SubscriptionInfo>
</Header>
<soap:Body>
<GetNewWordResponse
xmlns="http://www.textdisguise.com/TextDisguise/CaptchaService/">
<GetNewWordResult>
<CaptchaImageGuid>
82e16912-14c1-4253-bbcb-699585e3ba63
</CaptchaImageGuid>
<Url>
http://www.textdisguise.com/TextDisguise/CaptchaService/
CaptchaImage.aspx?
guid=82e16912-14c1-4253-bbcb-699585e3ba63
</Url>
</GetNewWordResult>
</GetNewWordResponse>
</soap:Body>
</soap:Envelope>
From this point on you can use the link defined by the
URL element in an HTML page. As detailed in the
following section you can then use the
ValidateImageWord method and the
CaptchaImageGuid to validate a text entered by
the user.
This section describes how to define a SOAP request based on some XML rather than starting on a WSDL definition.
This will be illustrated by continuing our previous example and by
invoking the ValidateImageWord method. This method
expects two parameters, an image identifier, the
CaptchaImageGuid, returned by the
GetNewWord method and the text entered by a user. The
ValidateImageWord method will return true if the text
entered by the user and the captcha image are consistent. The XML we will
be building our SOAP request on follows:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:LicenseInfo
xmlns:ns1="http://ws.strikeiron.com"
soapenv:mustUnderstand="0">
<ns1:UnregisteredUser>
<ns1:EmailAddress>john.doe@dot.com</ns1:EmailAddress>
</ns1:UnregisteredUser>
<ns1:RegisteredUser>
<ns1:UserID/>
<ns1:Password/>
</ns1:RegisteredUser>
</ns1:LicenseInfo>
</soapenv:Header>
<soapenv:Body>
<ValidateImageWord
xmlns="http://www.textdisguise.com/TextDisguise/CaptchaService/">
<captchaImageGuid>53fd3b31-1089-455b-a1b6-d78bc73f80b9</captchaImageGuid>
<word>SUBPRIMATE</word>
</ValidateImageWord>
</soapenv:Body>
</soapenv:Envelope>
Manually creating a SOAP Request
Select Design
mode
Click on the
button.
Create a new virtual user
Right-click on the Virtual User profiles
node and select New Virtual User. Enter
"VirtualUser", then click
"OK".
Add a new SOAP request
Right-click on the virtual user just created and select
"Insert into", then "SOAP
request".
Specify a manually-generated request
Check the Generate request manually
option.

Click Next.
Enter a name for the request
Enter a name for the manually-defined request.
In our example we'll name the request
ValidateImageWord.

Click Next.
Define the end-point of the request
This is the URL where the service is located. You can also
change this later on. In our example the service end point is
http://ws.strikeiron.com:80/textdisguise/CaptchaService.

Click Finish.
Check main configuration elements
At this stage the SOAP request is added to the virtual user.
You can rename this node to your convenience. In our example a
ValidateImageWord node has been added at the
end of the existing SOAP requests.

NeoLoad's right panel displays the main configuration
elements of the SOAP request. This includes the end point URL
which is defined by both the Server and
Path elements. These elements can be changed to
custom values. As with HTTP requests, the Path
element can been defined using NeoLoad variables.
Check the HTTP headers
Most SOAP request require at least two HTTP header elements
when SOAP is tunneled through HTTP. Always make sure that these
elements are correctly set. They are available in the
Advanced parameters dialog and are accessed by
selecting the
button:

In our example these elements are
ContentType and
SOAPAction.
Configuring the XML content
To configure the XML content, select the Edit XML
Content button.
At this stage you must define the XML request either by copying and pasting a request you have tested or by manually defining each element and attribute of the request. We will be using the first method in our example.
Copying and pasting an existing XML request using the
Flat XML panel is the easiest way to define the XML
content of the request. In our example we have copied and pasted the
XML containing the call to the ValidateImageWord
method:

You could also use the XML Tree panel to
manually define or to edit the XML using elements and attributes.
NeoLoad automatically constructs one view from the other (the XML tree
view from the flat view and vice versa). Selecting the XML
Tree tab would look like the following:

At this stage the request is completely defined and configured, you can immediately start testing it.
Testing the SOAP request
By creating a temporary virtual
user, NeoLoad provides an easy and quick method to check
your SOAP request. Select the
button to open the Check Virtual
User dialog.
Start checking
If you have already tested Virtual Users using NeoLoad you
will be familiar with the following dialog. By selecting the
Start checking button, NeoLoad will send the
SOAP request to the specified end point. NeoLoad displays the
associated response code and the number of failed assertions for
the sent request. When the line associated to the request is
selected the dialog displays further details in the lower part of
the dialog. You can choose to display the SOAP request that was
sent or the XML response.

![]() | Tip |
|---|---|
You can search the SOAP request or the XML response for a
particular expression by right clicking on the XML and selecting
the |
![]() | Tip |
|---|---|
You can neatly format SOAP request or the XML response by
right clicking on the XML and selecting the |
Based on the two previous examples, this section briefly shows you
how, just as for HTML requests, NeoLoad's variable extractor mechanism can
be used with SOAP requests. The objective is to be able to record a series
of invocations on the GetNewWord and
ValidateImageWord requests. Each
GetNewWord invocation will return a new image
identifier, the corresponding call to ValidateImageWord
will contain the associated identifier.
The basic idea is to
extract into a variable the image identifier, in other words the
CaptchaImageGuid, from
GetNewWord's response
and then, re-inject the value of the variable when invoking the
ValidateImageWord request.
Extracting the image identifier
CaptchaImageGuid from
GetNewWord's response
Go to Design Mode by selecting the
button
Select the Virtual users tab
Unfold the appropriate virtual user node
Select the GetNewWord request from which
the image identifier value will be extracted:

Go to the Variable extractors tab
Open the Advanced settings dialog by
selecting the
button.
Select the Variable extractors
tab:

Define a new variable
Select the
button to add a new variable. This opens a
Variables Extractor dialog. In our example we
will define the captchaImageGuid variable . The
way the value is identified and extracted is quite straightforward
since the XML response is simple. We want to extract anything
appearing between the starting
<captchaImageGuid> and ending
</captchaImageGuid> XML tags. The
following screen shot reflects these decisions:

At this stage the extraction part of the process is
complete. Each time the GetNewWord is invoked
NeoLoad will extract the value of the image identifier and set the
captchaImageGuid variable with it.
For more details on extracting variables refer to the section called “Creating a Variable Extractor” and to the reference guide.
Re-injecting the value into the
ValidateImageWord request using a
variable
Select the ValidateImageWord request in
which the image identifier value will be injected.
Select the Edit XML Content button to
configure the XML content.
Select the XML Tree tab
Select the captchaImageGuid element in
the XML panel
Select the Variable Picker dialog using
the ... button. You can also start typing
something like ${c and NeoLoad will suggest
variable name completions.
Choose the captchaImageGuid
variable
The XML Content dialog should look like the following:

With such a configuration NeoLoad will extract the image
identifier from the GetNewWord response and
inject it in the ValidateImageWord request.
This sequence can be replayed multiple times.
This section illustrates another means of defining SOAP request. Of all the techniques we have detailed up to now, it is the one that resembles the most what you usually do with HTTP requests: acting as a user and letting NeoLoad do the job of recording requests and responses. Our example uses the Google search API, so if you want to play around with this API you'll need to create an account and obtain a license key, you can go to the following URL Google APIs.
Example Description
The example is basic and really simple so that the underlying mechanisms are made clear:

The HTML page we will be recording consists of a
Test button and a textarea
containing the request to send. Hitting the Test button
sends the request to the correct end point, the response is then displayed
in the textarea. The request contains an invocation to
the Google search API. The body of the request contains among others, an
XML key element which you will have to obtain from
Google. The XML q element is the text we are actually
searching for. In our very basic interface we can change this by editing
the textarea content before invoking the
request.
The JavaScript code that manages the request opens the service end
point, consistently sets the HTTP headers and sends the content of the
textarea. When the response is received it's content is
copied to the textarea. Note the code only works with
Microsoft Internet Explorer. Other browsers will in any case refuse to
connect to a URL not belonging to the same domain as the test page.
The following listing contains the SOAPTest.html code and the code
of the function called when the Test button is
hit:
<html>
<body>
<h1>Google</h1>
<script type="text/javascript">
function doIEGoogle() {
textarea = document.getElementById("debugbox");
xhr = new ActiveXObject("Microsoft.XMLHTTP");
xhr.open('POST', "http://api.google.com/search/beta2");
xhr.setRequestHeader("SOAPAction", "urn:GoogleSearchAction");
xhr.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xhr.onreadystatechange =
function() {
if(xhr.readyState != 4) return;
if(xhr.status != 200) {
textarea.value = xhr.status + " " + xhr.statusText
+ "\n" + xhr.responseText;
return;
}
textarea.value = xhr.responseText;
};
xhr.send(textarea.value);
}
</script>
<form name="input" action="javascript:doIEGoogle()">
<input type="submit" value="Test">
</form>
<p></p>
<textarea rows="30" cols="100" name="debugbox">
<?xml version='1.0' encoding='UTF-8'?>
<SOAPENV:Envelope
xmlns:SOAPENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAPENV:Body>
<ns1:doGoogleSearch
xmlns:ns1="urn:GoogleSearch"
SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<key xsi:type="xsd:string">ABQIAAAA-YwsmHQspwIU9OcKL4b5rhTd9gLE95ZWCg
lQjFVS1XYlL9GwFBSIRS2y1JQBK8NE1ktm1oJWkWiTZQ</key>
<q xsi:type="xsd:string">load testing web applications</q>
<start xsi:type="xsd:int">0</start>
<maxResults xsi:type="xsd:int">3</maxResults>
<filter xsi:type="xsd:boolean">false</filter>
<restrict xsi:type="xsd:string"/>
<safeSearch xsi:type="xsd:boolean">false</safeSearch>
<lr xsi:type="xsd:string"/>
<ie xsi:type="xsd:string"/>
<oe xsi:type="xsd:string"/>
</ns1:doGoogleSearch>
</SOAPENV:Body>
</SOAPENV:Envelope>
</textarea>
</body>
</html>Recording the
PageTo record this test page we follow exactly the same procedure as
when recording an HTML page. From there we selected the
Test button and waited for the results from the Google
search API. We ended the recording at this stage. The following screen
shot depicts what the result of the recording looks like:

The recorded node contains a node called
/search/beta2.
![]() | Important |
|---|---|
As they do not belong to an HTML page, independent SOAP requests have no associated Think Time. If you want to test a sequence of SOAP calls, it is up to you to define delay actions to simulate latencies. For more details on delay actions see the reference guide. |
NeoLoad has correctly identified the request as a being a SOAP
request: the URL, Server,
Path and Method properties of the
request are consistently set.
Editing the SOAP Request
If you select the Edit XML Content button and
choose the XML Tree Tab, you can easily browse through
the SOAP request elements. This is typically where you could use
variables, changing for instance the search text for the
q parameter:

Checking the SOAP Request
As for any SOAP request, you can test the recorded request by
selecting the
button to open the Check Virtual
User dialog:

In our simple example, the Java script code just fills in the textarea with the received XML. In a real world scenario, the HTML page would obviously do otherwise, it would probably analyze the results, display them neatly in HTML and then let the user navigate on those results. Keep in mind that NeoLoad, just as for HTML requests, will let you extract information from the SOAP response and inject that information in further requests.
Recording from a real client
The previous sample shows how to record the request using a web browser. Please report to the reference guide to see how recording from your existing SOAP client.
Contrary to HTTP requests, which always belong to an HTML page, SOAP request are defined and managed by NeoLoad outside HTML pages. This has a particular consequence in the way NeoLoad displays the results. If you have defined a scenario that includes SOAP requests, these requests will not be detailed in the summary.
In our case the scenario only contains the HTML test page called
SOAPTest.html. If you take a look at the Test
Summary this is what you will get:

As depicted in the following screen shot, it is only in the
Values tab that you will see statistics on the SOAP
request, in our example the /search/beta2 request. Of
course all graphing functionalities are equally available for SOAP
requests (Graphs tab).
