10 April 2007 - 1.7 home user-guide eclipse jbossws intellij netbeans maven 1.X/2.X PDF files forums bugs sourceforge






Vote for soapUI at the WSJ Readers' Choice awards in the

'Best Web Services Utility' and

'Best Web Services Testing Tool'

categories

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:
  • Open 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.
  • 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
  • Name : the name of the request
  • Encoding : The encoding used by the request
  • Endpoint (read-only> : The endpoint for the request
  • Enable MTOM/Inline : Enable MTOM-based transfer and inlining of binary data in the request (see Attachments)
  • 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
  • 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.
  • Strip Whitespaces : strips outgoing requests of any unneccesary whitespaces, required by some servers.
  • Enable Multipars : bundles attachments assigned to the same attachment part into one multipart attachment instead of sending them as seperate attachments, see Multipart Attachments for more details.

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.

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

  • SOAP Request/Response : shows the message content editor
  • Request/Response Attachments : show the associated request/response Attachments editors
  • HTTP Headers : shows the request/response HTTP Header editor/viewer
  • SSL Info (Response only) : shows detailed response SSL Details for the current response

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 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 tab 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 tab 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 - 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).

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 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 in the Request Details Tab. 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 has been selected 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 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.


Next: Attachments and Inline Files