Feedback

  • Contents
 

SOAP Create Array

This SOAP tool turns an element, for example an RPC parameter, into a SOAP array. The array is created for values supplied as list of strings or just a number of empty elements that can be populated with complex data. The following is a sample array as produced by this tool (default argument):

<Element xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENC:arrayType="xsd:string[5]"
xsi:type="SOAP-ENC:Array">
<xsd:string>first</xsd:string>
<xsd:string>second</xsd:string>
<xsd:string>third</xsd:string>
<xsd:string>fourth</xsd:string>
<xsd:string>fifth</xsd:string>
</Element>

Notes: If the element already has child elements, they are all removed before the array elements are added.

The array items may be user defined (complex) types. Use the ‘XML Get Next Item’ tool to iterate through the‘Item Elements’ collection and populate the items. For example:

<Element xmlns:ns1=“uri:my-order-type”
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENC:arrayType="ns1:Order[3]"
xsi:type="SOAP-ENC:Array">
<ns1:Order>
<ns1:Product>Watchmacallit</ns1:Product>
<ns1:Quantity>3</ns1:Quantity>
<ns1:Price>19.99</ns1:Price>
</ns1:Order>
<ns1:Order>
<ns1:Product>Doodleany</ns1:Product>
<ns1:Quantity>9</ns1:Quantity>
<ns1:Price>12.49</ns1:Price>
</ns1:Order>
<ns1:Order>
<ns1:Product>Ozadingdong</ns1:Product>
<ns1:Quantity>1</ns1:Quantity>
<ns1:Price>43.15</ns1:Price>
</ns1:Order>

</Element>

Please refer to http://www.w3.org/TR/xmlschema-0 or http://www.w3.org/TR/xmlschema-2 for details on the XML Schema Datatypes.

Inputs

Element

Node of the parameter to turn into an array.

Values

List of strings to set as the array items. If not specified, empty elements will be created.

Size

Size of the array. If not specified, the length of the ‘Values’ list specifies the size. If both a ‘Values’ and ‘Size’ argument are given, the ‘Size’ has precedent and either not all items of the ‘Values’ list are included or the array is padded with elements containing the ‘Default Value’.

Default Value

Optional. Default array item value for padding items (if ‘Size’ is larger than size of ‘Values’ or no ‘Values’ defined).

Default: No value (padding elements will be empty)

Array Type

Optional. Type of the array. The argument may either be just the type name or have schema namespace prefix, such as xsd:string. If the type argument does not have a prefix, xsd will be used.

Default: xsd:string

Type Namespace

Optional. Namespace of the array type.

Default: http://www.w3.org/2001/XMLSchema

Encoding Prefix

Optional. Prefix of the encoding namespace (http://schemas.xmlsoap.org/soap/encoding/).

Default: SOAP-ENC

Item Element Name

Optional. Qualified name of the array items.

Default: Qualified array type (thus, the default item element name is xsd:string).

Item Element Namespace

Optional. Namespace of the array items.

Default: Namespace of the prefix of ‘Item Element Name’. If no prefix, empty namespace.

XSI Namespace

Optional. XML Schema Instance namespace.

Default: http://www.w3.org/2001/XMLSchema-instance

XSI Namespace Prefix

Optional. Prefix of the schema instance namespace.

Default: xsi

Include XSI Type Declaration

This box is checked by default and will add XSI type declaration for the SOAP Array. If all parameters are default, the declaration is:

xsi:type=“SOAP-ENC:Array”.

Uncheck this box if you do not want to add a type declaration for the array.

Declare Namespaces in Envelope

This box is checked by default and will declare the namespaces in the Envelope element (if they aren’t already). If any of the parent elements already has a NS declaration for a prefix and the namespace URI is different, the declaration will be added to the element, and not the Envelope.

If unchecked, the namespaces will be declared in the element itself.

Return Item Element Collection

This box is checked by default an returns collection of ‘Array Items’ containing all items of the array.

If unchecked, collection of array items will not be returned. I.e., 'Array Items' is returned as NULL.

Outputs

Item Elements

Node Iterator pointing to first element of a collection containing the nodes of the array items.

Count

Number of items in the array.

Note: this value is returned, even if ‘Return Item Collection’ is False.

Exit Paths

Success

This path is taken if the array is successfully created.

Empty

This path is taken if the designated node is empty.

Failure

This path is taken if the operation fails.