26 September 2007 - 1.7.6 home user-guide eclipse jbossws intellij netbeans maven 1.X/2.X PDF files forums bugs sourceforge






Working with Requests

An unlimited number of requests can be added to an operation in soapUI. Each request can have its own message content, 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:
  • Show Request Editor - opens the Request Editor described below
  • Add to TestCase - prompts to add the request to a TestCase. If no Testcase is available, soapUI will prompt to create both a TestSuite or TestCase if required
  • Add to MockService - prompts to add the requests' operation to a MockService. If a response is available for the request, it will be used as the default MockResponse.
  • Add as MockResponse Step (soapUI Pro only) - prompts to create a MockResponse Step this request in an existing or new TestCase. If a response is available for the request, it will be used as the response content.
  • Copy to TestRequests (soapUI Pro only) - opens dialog for copying/merging this request to existing TestRequests (see below)
  • 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
  • Online Help - Displays this page in an external browser

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

General Properties

  • Name : the name of the request
  • Description : an arbitrary description of the request, displayed as a tooltip over the requests node in the Navigator.
  • Message Size : The number of characters in the current request message (including whitespace).
  • Encoding : The encoding used by the request
  • Endpoint : The endpoint for the request
  • Bind Address : The local IP Address to bind to when sending the request.

Security/Authentication Properties

(override any defaults set for the endpoint)
  • Username : The username to use if the request requires authentication
  • Password : The password to use if the request requires authentication
  • Domain : The domain to use if the request requires NTLM authentication)
  • WSS-Password Type : Selects the type of WS-Security username/password token to dynamically add to each outgoing request. The above specified Username/Password values will be used fo the corresponding header values
  • WSS-TimeToLive : If set, automatically inserts a WSS TimeToLive token in any outgoing requests using the specified TimeToLive (in milliseconds)

Attachment-Related Properties

  • Enable MTOM/Inline : Enable MTOM-based transfer and inlining of binary data in the request (see Attachments).
  • Force MTOM : Alwasy use MTOM packaging for requests, even if there are no MTOM attachments.
  • Inline Response Attachments : the entire HTTP response for a request (including MIME/XOP attachments, etc..) will be shown in the response editor instead of attachments being parsed and visible in the Response Attachments tab.
  • Expand MTOM Attachments : received MTOM attachments will be inlined into the response message editor, allowing correct viewing and validation of the actual message.
  • Disable Multipart : Tells soapUI not to pack attachments with the same type into a multipart attachment, see Multipart Attachments for more details.
  • Encode Attachments : Tells soapUI to automatically encode attachments that have a corresponding WSDL part with the xsd-type set to either base6Binary or hexBinary.

Post-Processing Properties

  • Strip Whitespaces : Strips outgoing requests of any unneccesary whitespaces and xml comments, required by some servers.
  • Remove Empty Content : Removes empty elements/attributes from outgoing requests. This can be usefull in data-drive TestRequests which contain elements/attributes that not always contain data and should be removed in those cases.

The Request Editor

The request editor is opened by either double-clicking a request in the navigator or by selecting its Open Request Editor popup menu item, and displays the current request/response messages together with a toolbar and a number of detail tabs as shown below in a configurable Editor Layout.

Vertically on the left side of each editor are tabs for each editor view. The 'XML' source view is always available, soapUI Pro also adds the following addition views:

The following inspectors are available at the bottom of each message editor;

In soapUI Pro, the bottom right corner (under the scrollbar) contains a button to show a panorama view of the current editor view, allowing easier navigation around large/complex messages/views (available in all editor views, see screenshot to the right)

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-menu action described above
  • Add as MockResponse Step (soapUI Pro only) - prompts to create a MockResponse Step this request in an existing or new TestCase as described above.
  • Add to MockService - prompts to add the requests operation to a MockService, same as the request-menu action described above
  • Recreate Request - prompts to recreate 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 - prompts to create an empty soap-request with no soap-body
  • Clone Request - prompts to clone the request, same as the request-action described above. You will be prompted for a name for the new request and the new request will be placed after the cloned request.
  • 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. The combobox also contains the following options (as shown in the image):
    • [edit current...] option for changing the current new endpoint directly
    • [add new endpoint...] option for adding a new endpoint directly
    • [delete current...] option for deleting the current endpoint directly
  • Tab Layout - toggles between the tab and split request editor layouts as described below
  • Editor Orientation - changes the orientation of the request/response editors between left/right and top/bottom
  • Online Help - Displays this page in an external browser

Editor Layouts

The editor is available in 2 layout modes which can be toggled with the "Tab Layout" toolbar button (top right):

  • Split Layout (default, shown above) - the editor 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. It can also be turned off completely using the designated option in the UI Settings
  • Tabbed Layout - the editor displays the request/response areas in separate tabs available at the top of the editor window. Submitting a request automatically selects the response tab after the response has been received.

HTTP Headers

The HTTP Headers inspector at the bottom of each message editor displays the configured/received HTTP headers for the corresponding request/response message. For request message headers, buttons for adding/removing HTTP headers to be sent with the request are available from a toolbar below the table.

SSL Details

The SSL Details inspector at the bottom of the response editor displays a list of certificates that were involved in negotiating the current message exchange, the following screenshot shows this information for a default request to the PayPal API.

XML Source Editor

The request/response xml-editors support syntax-highlighting, undo/redo, copy/paste, etc. (soapUI Pro also adds a number of additional editor views to the default "XML"; "Outline" and "Form", together with a number of Message Inspectors shown below the request/response message) 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
  • Format XML - pretty-prints the xml in the editor
  • Add WSS-Username Token - prompts to add a WSS-Username SOAP-Header to the request message using the username/password specified in the Request Details Tab
  • Add WS-Timestamp - prompts to add a WS-Timestamp SOAP-Header to the request message
  • Undo/Redo/Copy/Cut/Paste/Find/Replace - standard editing functions
  • Go To Line - prompts for a line to move to
  • Show Line Numbers - toggles line-number visibility
  • Save as - prompts to save the editors content to a local file
  • Load from - prompts to load 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 and local Bind Adress. 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).

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 the "Cancel" 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 usability 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 canceling an ongoing request, the response will be shown in the response area when the request editor is made visible again.

A HTTP Proxy can either be set by using the http.proxyHost and http.proxyPort system properties or through the soapUI Proxy Preferences dialog. If both are available, the system properties take precedence.

Authentication

If the service requires authentication, soapUI will attempt to authenticate using the specified username/password/domain values specified either at the endpoint level via the Service Endpoints or those specified in the Request Details Tab (or a combination of both). 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.

If one of the WSS-Password Type options and/or the WSS-TimeToLive has been set in the Request Details Tab, soapUI will automatically add the corresponding WS-Security headers to the outgoing message, as can be seen in the http log;

Message Validation

When pressing Alt-V in the request or the response area, the contained message is validated against the operations message definition;
  1. The message body is validated against its schema definition
  2. The SOAP envelope and structure is validated in accordance with the WSDL and SOAP schemas
  3. If the message sends MIME attachments, their presence is validated in the Attachments Tab

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.

The response message editor has a similar popup menu to the request-editor containing a "Check WS-I Compliance" option. Selecting this option (if the WS-I validation tools have been configured correctly) will validate the current request/response message as configured and display a WS-I Compliance report in a separate window as described under WS-I Integrations.

Copy Requests

soapUI Pro includes this action to simplify bulk-updates of TestRequests with new content. The displayed dialog is as follows:

The options are:

  • Mode - the copy mode, see below
  • TestRequests - the TestRequests to copy/merge to
  • Create Backups - creates disabled backup TestRequest steps with existing request content
  • Open Requests - opens a list of modified TestRequests for manual postprocessing

When selecting ok, the existing request will be copied/merged as configured:

  • Copy : Overwrites the target TestRequest(s)
  • Update : Merges values from the source Request into the target TestRequest without overwriting
  • Keep Existing : Overwrites the target TestRequest after merging existing TestRequest values into the source Request

(Please note that the merging currently requires empty elements to merge into, it will not merge at the element level, only at the value level)


Next: Attachments and Inline Files