How should I configure my project to record and replay XML / SOAP over HTTP?
To use Silk Performer to record a XML based application do the following:
- Create a new project using the Application Type Web Services | XML/SOAP
- Check if the XML messaging protocol uses additional HTTP headers other than the "SOAPACTION" header. This can be achieved by recording the traffic and examining the headers which are sent in the record.log. If additional headers are used we must add them to the application protocol under 'SETTINGS | ACTIVE PROFILE | WEB | RECORD | RECORDING Tab | Add', and then insert additional headers.
- Select the Page-based level API because XML over HTTP calls can also be issued by Web applications.
To replay the XML/HTTP script please note the following:
SOAP can be invoked synchronous or asynchronous. However, when replaying a script be careful if invoking several methods that are dependent on each other.
Let's assume that the following 3 methods are being called:
These 3 methods have to be called synchronously because log in must occur before a product can be purchased. In such a case, since Silk Performer uses the command WebUrlPostBin to script HTTP-based SOAP traffic and WebUrlPostBin is an asynchronous command, the script must be tailored to achieve calling synchronously. The following approaches may be used to achieve this:
- Run as Single Threaded
- Use WebPagePost instead of WebUrlPostBin
- Script a WebThreadWait to wait for a SOAP call to complete.
The default setting for XML/SOAP applications is set to Single threaded. To confirm this go to 'SETTINGS | ACTIVE PROFILE | WEB | REPLAY | BROWSER | Check "Single-Threaded"'.
For SOAP calls from within a HTML page (this will mainly be executed by some java script or an applet) some type of WebPageXX function will be doing the Page request and the SilkPerformer WebEngine will wait till the whole page is loaded and consequently it will wait till all SOAP requests return their response
Customizing generated scripts:
As Silk Performer uses the WebUrlPostBin function this can be easily customized using string concatenation. (See "Load testing XML based b2b systems" white paper)
SOAP - Simple Object Access Protocol provides a way for applications to communicate with each other over the Internet, independent of platform. Unlike OMG"s IIOP, SOAP uses HTTP (port 80) in order to penetrate server firewalls, which are usually configured to accept port 80 and port 21 (FTP) requests.
SOAP was developed by Microsoft, DevelopMentor, and Userland Software and has been proposed to the Internet Engineering Task Force (IETF) as a standard
SOAP will define two types of messages, Call and response. This allows clients to request a remote procedure and to allow servers to respond to such requests. SOAP relies on XML to define the format of the information and then adds the necessary HTTP headers to send it. SOAP packages a method call into a XML string and then delivers that method request to a component instance via HTTP. SOAP clients requests are encapsulated with an HTTP POST (or M-Post) packet.
SOAP messages use the SOAPACTION HTTP header which is mandatory for HTTP based SOAP messages, and can be used to indicate the intent of the SOAP HTTP request. The presence of a SOAPACTION header field can be used by servers to appropriately filter SOAP request messages in HTTP.