Working with Requests

An unlimited number of requests can be added to an operation in soapui. Each request can have its own SOAP Request, endpoint, encoding, etc. Requests are mainly managed through the request-editor displayed when double-clicking a request node in the navigator (described below)

Request Actions

The following actions are available from the request nodes' right-button menu:
  • Clone Request - prompts to clone this request, the cloned request will be added to the operation and its request-editor will be opened.
  • Rename - prompts to rename the request in the navigator.
  • Delete - prompts to remove the request from its operation.
  • Add to Testcase - prompts to add the request to an existing testcase. If no testcase is available, soapui will prompt to create both a testsuite and/or testcase if required.

Request Details Tab

The "Details" tab shown in the bottom-left shows the following values when a Request node is selected in the navigation tree
  • Name : the name of the request
  • Encoding : The encoding used by the request
  • Endpoint : The endpoint for the request
  • Username : The username to use if the request requires authentication (editable)
  • Password : The password to use if the request requires authentication (editable)
  • Domain : The domain to use if the request requires NTLM authentication (editable)

The Request Editor

The request editor is more or less the main window in soapui, both for request and for test-requests. It is divided into a left request-area and a right response-area; submitting the requests posts it to its endpoint and displays the result in the right area.

When moving focus to one of the editors, the dividing splitpane will automatically be moved to give the focused editor a larger visible area, diminishing the requirement to resize the splitpane manually when working with request/response messages. This behaviour will be disabled when manually dragging the split-pane to a desired position and re-enabled when changing the splitpane orientation or when closing/re-opening the request-editor for the current request.

The request/response xml-editors support syntax-hightlighting, undo/redo, copy/paste, etc. The following actions are available from the request/response editors right-button menu:
  • Validate - validates the editors content against its message definition as described below.
  • Undo/Redo/Copy/Cut/Paste - standard editing functions.
  • Find/Replace - opens a standard File/Replace dialog.
  • Save as - prompts to save the editors content to a local file.
Also, a number of custom keyboard actions are available to make your "everyday-soapui-editing" easier:
  • Alt-Enter : submits the request to the specified endpoint
  • Alt-X : cancels a running submit
  • Alt-left/right arrow : moves between element values
  • Shift-Tab : moves focus between request/response areas

Submitting requests

When submitting a request using either the submit toolbar button or the Alt-Enter editor action, the request message is sent to the selected endpoint using the specified encoding. Submittal is done in a background thread so any number of requests can be running simultaneously (an animated icon in the navigator shows that they are running).

If the service requires authentication, soapui will attempt to authenticate using the specified username/password/domain values. Currently supported authentication types are those supported by HttpClient, ie Basic, Digest and NTLM authentication. SSL should work (=not tested!) if you use https urls and install JSSE accordingly.

During submittal, the request/response editors are made read-only and all actions except the cancel button in the toolbar are disabled. One can cancel an ongoing request either by a toolbar button or by pressing Alt-X in one of the editors. If you choose to close the editor window while a request is running, you will be prompted if you first want to cancel the ongoing request. Depending on the state of the request, its thread may actually continue in the background even though soapui shows it as canceled, but from a useability point-of-view, you should never notice.

Once a response has been received, it will be displayed in the response area and a log message will be displayed in the soapui log view and the request editors status bar showing the time taken and size of the received response. If you choose to close the request editor without cancelling an ongoing request, the response will be shown in the response area when the request editor is made visible again.

Editor Toolbar

The request-editor toolbar has the following actions (from left to right)

  • Submit - submits the request to the specified endpoint.
  • Add to Testcase - prompts to add the request to a testcase, same as the request-action described above
  • Recreate Request - recreates the request xml from the operations input message definition. Also prompts if any values in the current request should be kept in the recreated request
  • Create Empty - creates an empty soap-request with no soap-body
  • Clone Request - prompts to clone the request, same as the request-action described above. The new eq
  • Cancel Request - cancels an ongoing request (disabled if no request is running)
  • Endpoint Combo - a combo-box listing the endpoints available for this requests' operations' interface
  • Request Encoding - sets the encoding to use when sending the soap-request, defaults to "UTF-8"
  • Editor Orientation - changes the orientation of the request/response editors between left/right and top/bottom

Message Validation

When pressing Alt-V in either the request or response area, the contained message is validated for valid xml and against its operations message definition.

Validation errors are shown in a list-box displayed under the editor. Double-clicking an error will move the corresponding editor caret to the line of the error (if possible).

If the message is valid the error-list is hidden and an Ok-message is displayed.

Validation is currently only supported for literal-encoded messages (both rpc and document), SOAP-encoded messages are not supported.


Next: TestSuites and TestCases