Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2022.2

...

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,from legacy testing tools,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. 

...

  • Fixed: Use this option if you want to enter a literal value (such as a string) by completing form fields. If you select Fixed in the Value box, enter the literal value for your tool parameters in the control that opens. The nature of the control will vary depending on the method. For more information, see Specifying Literal Values.
  • 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.test suite.responder 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.

  • Input: Use this option if this tool is chained to another tool and you want the result from the first tool to be used as the parameter for the second tool. 

...

Table of Content Zone
maxLevel2
minLevel2
locationtop

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.Generating a Data Source Template for Populating Message Elements in SOAtest.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.

minoccurs/maxoccurs Enforcement

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.

XML Encoding

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.

  • Choose Unicode to preserve all unicode characters supported by XML specifications. Only restricted XML characters, such as "<" and "&", will be encoded.
  • Choose ASCII to preserve all ASCII characters. Non-ASCII unicode characters, as well as restricted XML characters, will be encoded.
  • Choose None to disable XML encoding. Characters from the field value, including restricted XML characters, will be represented as-is in the final document.

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:

  1. Right-click that element, then choose Replace with Data Source Value.
  2. In the Replacement Settings dialog that opens, specify the following, then click Next.
    • The replacement mode (entire element or content only). Note that this option is not applicable to Form JSON,  where it replaces an entire object or array.
    • Whether you want to use a data source value or an XPath.
  3. In the next page, specify the appropriate data source column or XPath, then click Finish.

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
Anchor
Populating a Set of Elements with Automatically-Generated 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.

Substituting Elements

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
Anchor
Using Data Source Values to Configure if Optional Elements Are Sent
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:

  1. Right-click the element’s tree node.
  2. Choose Use Data Source> Exclude Element with Empty String.
  3. In the tool configuration panel, ensure that the appropriate data source column is selected under Use data source: Exclude with empty string.

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:

  1. Right-click the parent element’s tree node.
  2. Choose Use Data Source>  Exclude Attribute with empty string>  [attribute you want to configure].
  3. In the tool configuration panel, ensure that the appropriate data source column is selected under Use data source: Exclude [attribute] with empty string.

Using Data Source Values to Configure if Nil or Null Attributes Are Used
Anchor
Using Data Source Values to Configure if Nil or Null Attributes Are Used
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]).



When the data source has an empty string, the nil attribute will be sent as part of the message. If a value is specified, the nil attribute will not be sent; instead, the specified value will be used.

For instance, assume you have the following data source:

Element ValueNil with Empty String
valuevalue
value

value


Nil with Empty String takes precedence over Element Value. Consequently, xsi:nil="true" will be sent regardless of the value in the Element Value column whenever the Nil with Empty String column has an empty string.


Info

Using Nil with Repository Data Sources

This description does not apply to repository data sources. For details on how to to set a respository data source value to nil, see Setting Values to Null or Exclude.


...