SOASTA CloudTest supports testing web sites and web applications that use the Windows Communication Foundation (WCF) as their communication protocol. CloudTest handles the encoding (for outgoing messages) and decoding (for incoming responses) of WCF’s .NET binary XML layer, and then presents plain text in both message responses and in test results within CloudTest.
The Recording Editor supports WCF applications that use .NET binary XML. When recording from a WCF-based application, the Recording Editor will automatically decode the binary XML and then display the plain-text version. Recording from WCF-based applications that do not use binary XML was already possible since only plain text was involved in those cases. Once this target exists, you can record WCF-based binary sites using the Recording Editor in the same manner as you would with any other site.
To get started, use the following steps:
- Create the WCF-based Target
- In the Central list, select Targets and then click New.
- The Target Definition Wizard appears. Click Next. The Start by Selecting a Target Type step appears.
- Choose SOAP with a WSDL URL and then click Next.
The Define the WSDL Target step appears.
- Enter a Target Name and the WSDL URL for the WCF service. If authentication is required for the URL, provide it in the given fields.
Note: The Target Name will be required when you convert your WCF-based recording to a test clip.
- Once you have supplied the target information, click Next. A summary screen appears to display the data you entered. Review this information and click Finish when you're ready.
- Repeat these steps for any additional WSDL URLs required to conduct your test.
- Convert the WCF-based Recording to a Test Clip
You must create a recording containing all the SOAP operations that you wish to use, and then convert that recording to a clip. You cannot create a new WCF test clip "from scratch" (e.g. manually).
- Start your SOASTA Conductor.
- In the Central list, click HTTP(S) Recording and then click New to start a new recording of your WCF-based site.
- Open the WCF site in your web browser in a second window and then return to CloudTest to click Record.
- Apply any filtering to the recording that you’d like and when ready, click Convert to a Clip. The Create a Test Clip from a Recording Wizard appears.
The display of messages can be filtered so that only those messages that meet the specified criteria will display. This can be very useful in narrowing the set of messages to examine. The filter is available in the upper right hand corner.
- Enter a clip name and select a clip timing type (use Sequenced if you’re unsure) and then click Next. The Bursts and Think Times page appears.
The Match Targets to Recording Messages page appears.
- Wait for the target(s) that you created in the previous set of steps to be auto-selected from the Available Targets list and placed into the Selected Targets list and then click Next.
- The Create Clip summary page appears. Review the settings and then click Next again to create the test clip. The test clip is created and the Summary page appears.
In the Next Steps section, choose Go to the Clip Editor in order to inspect messages in the WCF-based test clip.
- Editing and Playing a WCF-based Message in the Clip Editor
- When viewing a WCF test clip, you must use the XML view, not the Form view. This will be enabled by default when you open a WCF clip.
- With the WCF-based test clip open in the Clip Editor, select a message that you’d like to edit and then double-click it.
The selected message is opened in the sub-pane with the tab title Selected: <MessageName> active.
The decoded content is presented as plain text just as with any other message.
- You can edit the message here by navigating through the nodes in the sub-pane tree.
- Optionally, add a new message to the test clip. To add a new message, you must copy and paste an existing message of the same operation and use that as a starting point. You cannot drag new WCF messages up from the list of operations in the Clip Builder.
Note: The XML view is editable, but the user must take care to use only well-formed XML.
- Play the message by clicking the Play button on the sub-pane toolbar. The tab will switch to Results when the response is received.
When you play a message in the Clip Editor, if it is using binary XML, CloudTest will automatically encode it before sending the request.
Similarly, message responses are decoded before display in the Message Editor sub-pane of the Clip Editor. The decoded response will be displayed in results (such as in the Result Details widget).