...
Info |
---|
Populating the Form Input View from the Literal 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. |
...
In the main panel, you will see a tree-based representation of the message. For SOAP-based tools, there are two sub-tabs in the main area of this view: the SOAP Body and the SOAP Header tabs. For information on the Header sub-tab, see Adding SOAP Headers.
...
Note that 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 the
Conditional Content Product: (Virtualize) Product: (Virtualize) respondersv-attr:0A010204015A9054C88481D043445E2F 0A010204015A9054C88802B9600247DF theresponder 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 in Conditional Content | | Product: (Virtualize) | Product: (Virtualize) | |||
sv-attr:0A010204015A9054C88481D043445E2F | 0A010204015A9054C88802B9600247DF |
Anchor | ||||
---|---|---|---|---|
|
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.
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 | ||||
---|---|---|---|---|
|
To have values stored in a data source dictate whether a value is sent for an optional element:
- Right-click the element’s tree node.
- Choose Use Data Source> Exclude Element with Empty String.
- 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:
- Right-click the parent element’s tree node.
- Choose Use Data Source> Exclude Attribute with empty string> [attribute you want to configure].
- 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 | ||||
---|---|---|---|---|
|
(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 Value | Nil with Empty String |
---|---|
value | value |
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 SourcesThis 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. |
...