...
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.
...
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 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:
- 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 thetest 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.
- 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 | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||
Using Excel Spreadsheets to Generate Dynamic Array or Sequence ValuesManually 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 MessagesYou 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 EnforcementBy 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 EnforcementBy 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 EncodingBase 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 EncodingBy 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 ArrayTo 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 ValuesYou 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 ValuesThe 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. Substituting ElementsIf 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 SentTo 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,
|
...