In this section include:
You can specify how you want to enter messages from the Input Mode drop-down list in message tools and responders (e.g., Request, Response, Payload). From Input enables you to enter parameters in UI form fields, which provides a simple way to view and work with an existing message (e.g., a sample from developers, traced from the server,etc.). Once a message is copied into the Literal view, the Form Input view is populated in a schema-aware and schema-constrained manner so that you can easily edit, manage, and parameterize the message.
Populating the Form Input View from the Literal XML view
If you want a simple way to view and work with an existing XML message (e.g., a sample from developers, traced from the server, from legacy testing tools, etc.), you can copy it into the Literal view, then open the Form Input view. Once a message is copied into the Literal view, the Form Input view is populated in a schema-aware and schema-constrained manner that is much simpler to edit, manage, and parameterize.
The top of the Form Input View provides an operation drop-down menu that lists the available methods/operations you can call and work with.
The operation list is created automatically when a valid WSDL URI is entered. You can select which operation you want to work with by selecting an operation from the list.
The main panel contains an expandable representation of the message. SOAP-based tools have sub-tabs for the SOAP Body and the SOAP Header. For information on the Header sub-tab, see Adding SOAP Headers. The SOAP Body and SOAP Header tabs are not available if you chose the Plain XML message type in the WSDL tab.The available controls let you specify how you want to specify the parameter values for each node in the tree. Options include:
Parameterized: Use this option to use values specified in a data source. You must first add the appropriate data source to theresponder or test suite.
Auto Use this option to automatically generate parameter values. Automatic parameter generation is particularly useful when you want to assess the service’s constraints and determine what type of data will fail. If you selected Auto, you do not need to enter anything to the right of the control. Values will be generated automatically. This option is not applicable to Form JSON.
Script: Use this option if you want a script to generate parameters at runtime. If you select Script, click Edit Script, then enter the method’s location (or the method itself) in the dialog box that opens. The method should be a static Java method that returns an object (or a Java class that contains a default constructor) and that meets the signature the Web service is expecting. Parasoft will transform the method into a SOAP parameter and send it as a SOAP call when the tool is executed. For general guidelines on adding methods, see Extensibility or Scripting Basics.
You can send a literal value as part of the message if Fixed was chosen in the Value box Depending on the method, a number of different options may be available.
You can either configure options for sending simple parameters as the literal value, or you may configure options for sending nested parameters within complex types of objects (such as an array).
When configuring a simple parameter, the options will vary depending on whether a data source was specified in the tool, and if the XML schema of the WSDL contains any nillable elements.
The following options may be available when configuring values for simple parameters:
If the WSDL specified in the tool contains an array of objects, the GUI beneath the Value box displays an Index column and a Value column. You will be able to nest parameter values that the tool will send as part of the message.
You can parameterize complex XML elements from a Parasoft Data Repository data source column, which may reference zero, one, or multiple hierarchical record values.
Add a Parasoft Repository Data source as described in Creating a Repository Data Source.
The following advanced options can be performed in the Form Input view:
Using Excel Spreadsheets to Generate Dynamic Array or Sequence Values
Manually creating a data source for parameterizing large, complex messages can be time-consuming and tedious. You can configure SOAtest and/or Virtualize to automatically generate a CSV data source template based on the structure of the message that you want to parameterize.
Details on how to do this are provided inGenerating a Data Source Template for Populating Message Elements in SOAtest or Generating a Data Source Template for Populating Message Elements in Virtualize.
Sending Compact and Beautified Messages
You can right-click the root element in the messaging tool and choose Beautify to format messages for readability. You can also send compact messages (messages formatted to fit on a single line) by by right-clicking the node and disabling the Beautify option.
Schema Type Enforcement
By default, SOAtest and/or Virtualize checks to ensure that the parameter value entered conforms to its specified schema type (shown when you hover your cursor over the element). If you want to use a value that does not conform to the schema type, disable the schema type enforcement by right-clicking the element, then choosing Enforce Schema Type. To disable schema enforcement for child elements, right-click the parent element, then choose Ignore Schema Type of Children. If you later want to re-enable schema type enforcement, choose the appropriate right-click option.
By default, SOAtest and/or Virtualize checks to ensure that the parameter value entered conforms to minoccurs and maxoccurs constraints. If you want to use a value that is beyond these limits, right-click that element, then choose Enforce Occurrences. If you later want to re-enable schema type enforcement, repeat the same action.
Base 64 Encoding
Base 64 encoding is not enabled by default. To use base 64 encoding, right-click the element you want encoded, then choose Base 64 Encoding from the shortcut menu. If you later want to disable base 64 encoding, repeat the same action.
By default, XML values are encoded as unicode characters, but you can right-click an element and choose XML Encoding> Unicode or ASCII or None to change the encoding.
Adding Multiple Values to an Array
To quickly add multiple values to an array, right-click the related element, then choose Insert Multiple. In the dialog that opens, use the available controls to specify the values that you want to use.
Replacing Specific Elements with Data Source Values
You can configure SOAtest and/or Virtualize to replace an entire element (or just its content) with a value from a data source or XPath when the tool is executed. To do this:
If you later want to stop using the data source or XPath value, right-click the element and choose Remove Replacement Setting.
Populating a Set of Elements from a Data Source Values
The Populate feature allows you to automatically fill a set of form fields using values stored in an existing data source (as opposed to specifying values manually). For example, you can create a data source with one column per element then automatically add the corresponding values to all of the available elements.
To populate an element’s fields using data source values, right-click that field in the Form Input view, then choose Populate. Leave Map parameter values to data source columns enabled, then specify exclusion and nillable settings if applicable.For additional details, see Populating and Parameterizing Elements with Data Source Values.
Populating a Set of Elements with Automatically-Generated Values
The Populate feature can also automatically generate simple values for a set of form fields.
To populate an element’s fields using simple automatically-generated values, right-click that field in the Form Input view, then choose Populate. Clear Map parameter values to data source columns, then specify exclusion and nillable settings if applicable.For additional details on the options available in the Populate wizard (Element Exclusion, Nillable Elements, Attribute Exclusion), see Populate Wizard Options.
If you want to replace the original element with another element defined in a schema (for example, to use a foreign-language equivalent of the original element name, or to use a different variation of the original element), you can use the Substitute Element feature. Substituted elements need to have the same type as the original—unless the original element’s type is anyType. In that case, you can replace it with any element that is a valid substitution (any element that belongs to the 'substitution group' defined by the abstract element that's being substituted/replaced).
To substitute an element, right-click the original element, then choose Substitute Element from the shortcut menu. In the dialog that opens, specify the schema that contains the new element, then add the desired element to the substitution list.
Using Data Source Values to Determine if Optional Elements or Attributes Are Sent
(Only available if a data source is included in the responder or test suite and the WSDL or schema specifies that minOccurs=0 for that parameter—Does not apply to repository data sources)
When you are working with a message with optional elements or attributes, you can use a data source to configure whether or not the optional elements or attributes are sent as part of the message. After the proper configuration (described below), an empty string in the designated data source column will tell SOAtest and/or Virtualize NOT to include the optional elements or attributes in the message. If the data source has an actual value, that value will be sent as part of the message.
Using Data Source Values to Configure if Optional Elements Are Sent
To have values stored in a data source dictate whether a value is sent for an optional element:
Using Data Source Values to Configure Optional Attributes Are Sent
To have values stored in a data source dictate whether a value is sent for an optional attribute:
Using Data Source Values to Configure if Nil or Null Attributes Are Used
(Only available if a data source is included in the responder or test suite and the nil check box for the given element is not selected — Does not apply to repository data sources)
To have values stored in a data source dictate whether a nil attribute or an actual value is used for various elements, right-click the related tree node, then choose Configure nil> Use Data Source: Set nil with empty string [element] (for JSON, the label is Configure null> Use Data Source: Set null with empty string [element]).
For instance, assume you have the following data source:
Nil with Empty String takes precedence over Element Value. Consequently,
The SOAP Header sub-tab in the Form Input view allows you to specify header parameters. To add a header, perform the following from the Header sub-tab of the Form Input view:
Click the Add button. The Add New SOAP Header dialog displays.
If you selected WS-Security from the Available Header Types, the following options are available via the Timestamp, Username Tokens, BinarySecurityToken, and Options tabs in the right GUI panel:
The following options are available in the Timestamp tab:
|Send Timestamp||Select to add a timestamp value.|
|Dynamically generate timestamp||Select to generate a timestamp value each time a message is generated.|
|wsu:Created||(Only available if Dynamically generate timestamp is not selected) Manually enter a timestamp value. This value will be the same for each message generated.|
|Send Expires||Select to add an expiration value.|
|Time Interval between Created and Expires||(Only available if Send Expires is selected) Manually enter a time interval to take place between the created and expires timestamps.|
The following options are available in the Username Tokens tab:
|Send Username Token||Select to add a username value.|
|wsse: Username||Enter a username.|
|wsse: Password||Enter a password.|
|Add Nonce||Select to add a nonce value.|
|Dynamically generate Nonce||Select to randomly generate a nonce value each time a message is generated.|
|wsse:Nonce||(Only available if Dynamically generate Nonce is not selected) Manually enter a Nonce value. This value will be the same for each message generated.|
|Add Timestamp||Select to add a timestamp value.|
|Dynamically generate timestamp||Select to generate a timestamp value each time a message is generated.|
|wsu:Created:||(Only available if Dynamically generate timestamp is not selected) Manually enter a timestamp value. This value will be the same for each message generated.|
The following options are available in the Username Tokens tab:
|Tokens||Select a BinarySecurityToken from the Tokens drop-down list.|
|Add||Click to add a new BinarySecurityToken. In the Add BinarySecurityToken dialog that displays, specify the wsuID of the token.|
|Remove||Click to remove a BinarySecurityToken.|
The following options are available in the Options tab:
Enter or select from the drop-down menu, the namespace of the Username token header. The default corresponds to the latest WS-Security spec from OASIS.
Selecting a WS-Security URI also changes the WS-Security Utility URI correspondingly. However, you can change the WS-Security Utility URI so that it does not correspond to the WS-Security URI.
|WS-Security Utility URI||Enter or select from the drop-down menu, the utility namespace of the Username token header. The default corresponds to the selection in the WS-Security URI menu.|
If you selected WS Addressing from the Available Header Types, the following four Header types are sent by default: Action, To, MessageID, and Reply/To. The following headers are not by default: RelatesTo, From, FaultTo. These Header types can be configured via the Action/To, MessageID/ReplyTo, and RelatesTo/From/FaultTo tabs in the right GUI panel. Also by default, the 2004/08 namespace is used (i.e.).
The following options are available in the Action/To tab:
|wsa:Action||Specifies the WS Addressing Action value.|
|wsa:To||Specifies the WS Addressing To value.|
|WS-Addressing URI||Enter or select from the drop-down menu, the WS-Addressing URI.|
The following options are available in the MessageID/ReplyTo tab:
|wsa:MessageID||Specifies the WS Addressing MessageID. The default automatically generates a unique value.|
Specifies the WS Addressing ReplyTo endpoint reference to which the return message will be sent.
The following options are available in the RelatesTo/From/FaultTo tab:
|Send wsa:RelatesTo||Specifies the WS Addressing RelatesTo value.|
Specifies the WS Addressing From endpoint reference from which the return message is sent.
If you selected SAML 1.1 Assertion from the Available Header Types, see Adding SAML Headers.
If you selected SAML 2.0 Assertion from the Available Header Types, various options will be available that correspond to the OASIS SAML Token Profile. For more information, see
If you selected WS ReliableMessaging from the Available Header Types, the following options are available:
|wsrm:Sequence||Specifies the wsrm:Sequence parameters such as the Identifier and MessageNumber.|
|wsrm:AckRequested||Specifies the wsrm:AckRequested parameters such as the Identifier and MaxMessageNumberUsed. These options are only available if the Send AckRequested check box is selected.|
If you selected Custom from the Available Header Types, the following options are available:
|Views||Select the desired view from the drop-down menu and configure accordingly.|
|Populate||Fills SOAP array and element parameters. Clicking this button also sets any element nils to false and expands them out. This button is only enabled if the tool is created from a WSDL.|
If you selected Import Schema Element as Header from the Available Header Types, a dialog appears from which you can load declared elements from a schema location. After loading elements, you can select multiple elements for the SOAP header. Once you click OK, a new header with the chosen element's structure will be added to the tool.
The Header sub-tab in the Form Input view allows you to specify header parameters. When adding SAML 1.1 headers, you can choose from four types of SAML confirmation methods:
To add a Sender-Vouches: Unsigned confirmation method, perform the following from the Header sub-tab of the Form Input view:
To add a Sender-Vouches: Unsigned: SSL confirmation method, perform the following from the Header sub-tab of the Form Input view:
To add a Sender-Vouches: Signed confirmation method, perform the following from the Header sub-tab of the Form Input view:
To add a Holder-of-Key confirmation method, perform the following from the Header sub-tab of the Form Input view:
SAML Statements must be added during the creation of an assertion. The following choices are available:
SAML Statements can be added and modified after an assertion has been created in order to extend or customize the assertion. To do this: